Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config item for if pgstats will be collected #1402

Merged
merged 1 commit into from
Oct 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This document contains release notes for the current major release and all patch
For prior releases,
see [PRIOR\_RELEASE\_NOTES.md](PRIOR_RELEASE_NOTES.md).

## 12.17.1 (2017-10-10)
## 12.17.2 (2017-10-17)

This release has security updates and enhancements.
- Update the version of java to 8u144 to address CVE-2017-3526.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.17.1
12.17.2
14 changes: 12 additions & 2 deletions oc-chef-pedant/spec/api/stats_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

describe "/_stats API endpoint", :stats do

RESPONSE_TYPE_MAP = {
ERLANG_RESPONSE_TYPE_MAP = {
"erlang_vm_time_correction" => "UNTYPED",
"erlang_vm_thread_pool_size" => "GAUGE",
"erlang_vm_threads" => "UNTYPED",
Expand Down Expand Up @@ -39,7 +39,10 @@
"erchef_pooler_queued_requestors" => "GAUGE",
"erchef_pooler_members_max" => "GAUGE",
"erchef_pooler_members_free" => "GAUGE",
"erchef_pooler_members_in_use" => "GAUGE",
"erchef_pooler_members_in_use" => "GAUGE"
}

PGSTATS_RESPONSE_TYPE_MAP = {
"pg_stat_n_conns" => "GAUGE",
"pg_stat_n_active_conns" => "GAUGE",
"pg_stat_tidx_blks_hit" => "COUNTER",
Expand All @@ -61,6 +64,12 @@
"pg_stat_seq_scan" => "COUNTER"
}

if Pedant::Config.chef_pgsql_collector
RESPONSE_TYPE_MAP = ERLANG_RESPONSE_TYPE_MAP.merge(PGSTATS_RESPONSE_TYPE_MAP)
else
RESPONSE_TYPE_MAP = ERLANG_RESPONSE_TYPE_MAP
end

let(:request_url) { "#{platform.server}/_stats" }
let(:response_body) do
RESPONSE_TYPE_MAP.map do |name, type|
Expand All @@ -77,6 +86,7 @@
end

# Don't turn on any of the tests unless we have a password.
# and are not running on the backend of a tiered setup.
if Pedant::Config.pedant_platform.stats_password
it "returns a list of collected statistics", :smoke do
get(request_url, nil, auth_headers: auth_headers).should look_like({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
:hostname => node['hostname'],
:ssl_version => ssl_version,
:reindex_endpoint => reindex_endpoint,
:required_recipe_enabled => node['private_chef']['required_recipe']['enable']
:required_recipe_enabled => node['private_chef']['required_recipe']['enable'],
:chef_pgsql_collector => ( node['private_chef']['postgresql']['enable'] &&
!node['private_chef']['postgresql']['external'] )
}.merge(node['private_chef']['oc-chef-pedant'].to_hash))
end
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,5 @@ log_file "<%= File.join(@log_directory, "http-traffic.log") %>"
<%- if @reindex_endpoint %>
reindex_endpoint "<%= @reindex_endpoint %>"
<%- end %>

chef_pgsql_collector "<%= @chef_pgsql_collector %>"