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

Change http_request metric names to match go #15

Merged
merged 3 commits into from
Sep 10, 2015
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
4 changes: 2 additions & 2 deletions lib/prometheus/client/rack/collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def init_request_metrics
:http_requests_total,
'A counter of the total number of HTTP requests made.')
@requests_duration = @registry.counter(
:http_request_durations_total_microseconds,
:http_request_duration_total_microseconds,
'The total amount of time spent answering HTTP requests ' \
'(microseconds).')
@durations = @registry.summary(
:http_request_durations_microseconds,
:http_request_duration_microseconds,
'A histogram of the response latency (microseconds).')
end

Expand Down
2 changes: 1 addition & 1 deletion spec/examples/metric_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exception = Prometheus::Client::LabelSetValidator::ReservedLabelError

expect do
described_class.new(:foo, 'foo docstring', __name__: 'reserved')
described_class.new(:foo, 'foo docstring', __name__: 'reserved')
end.to raise_exception exception
end

Expand Down
2 changes: 1 addition & 1 deletion spec/prometheus/client/formats/text_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

describe Prometheus::Client::Formats::Text do
let(:summary_value) do
{ 0.5 => 4.2, 0.9 => 8.32, 0.99 => 15.3 }.tap do |value|
{ 0.5 => 4.2, 0.9 => 8.32, 0.99 => 15.3 }.tap do |value|
allow(value).to receive_messages(sum: 1243.21, total: 93)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/prometheus/client/rack/collector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

{
http_requests_total: 1,
http_request_durations_total_microseconds: 2,
http_request_durations_microseconds: { 0.5 => 2, 0.9 => 2, 0.99 => 2 },
http_request_duration_total_microseconds: 2,
http_request_duration_microseconds: { 0.5 => 2, 0.9 => 2, 0.99 => 2 },
}.each do |metric, result|
expect(registry.get(metric).get(labels)).to eql(result)
end
Expand Down