Skip to content

Commit

Permalink
Merge pull request #15 from kirussel/rename_rack_metrics
Browse files Browse the repository at this point in the history
Change http_request metric names to match go
  • Loading branch information
grobie committed Sep 10, 2015
2 parents 43b4abe + 9d88e00 commit 02a57fe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
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

0 comments on commit 02a57fe

Please sign in to comment.