diff options
author | Ben Kochie <superq@gmail.com> | 2017-07-12 14:37:08 +0200 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2017-07-12 14:37:08 +0200 |
commit | e9363229b749db194a999dc76787ba92fd127dbc (patch) | |
tree | e59f926686d4830e9ec628a1bd748aa29e478f90 /spec | |
parent | 571c4f5a4f1b9f6a21f3f3af462fac4c1ea5f42a (diff) | |
download | gitlab-ce-e9363229b749db194a999dc76787ba92fd127dbc.tar.gz |
Update rack metric names
* Follow Prometheus naming conventions[0].
* Simplify metrics by adding response lables to the histogram.
* Use standard `http_request_duration_seconds_...` names for the histogram.
[0]: https://prometheus.io/docs/practices/naming/#metric-names
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/metrics/connection_rack_middleware_spec.rb | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/spec/lib/gitlab/metrics/connection_rack_middleware_spec.rb b/spec/lib/gitlab/metrics/connection_rack_middleware_spec.rb index 94251af305f..12392b8ddda 100644 --- a/spec/lib/gitlab/metrics/connection_rack_middleware_spec.rb +++ b/spec/lib/gitlab/metrics/connection_rack_middleware_spec.rb @@ -22,12 +22,6 @@ describe Gitlab::Metrics::ConnectionRackMiddleware do allow(app).to receive(:call).and_return([200, nil, nil]) end - it 'increments response count with status label' do - expect(described_class).to receive_message_chain(:rack_response_count, :increment).with(include(status: 200, method: 'get')) - - subject.call(env) - end - it 'increments requests count' do expect(described_class).to receive_message_chain(:rack_request_count, :increment).with(method: 'get') @@ -40,7 +34,7 @@ describe Gitlab::Metrics::ConnectionRackMiddleware do Timecop.freeze(execution_time.seconds) end - expect(described_class).to receive_message_chain(:rack_execution_time, :observe).with({}, execution_time) + expect(described_class).to receive_message_chain(:rack_execution_time, :observe).with({status: 200, method: 'get'}, execution_time) subject.call(env) end @@ -49,11 +43,6 @@ describe Gitlab::Metrics::ConnectionRackMiddleware do context '@app.call throws exception' do let(:rack_response_count) { double('rack_response_count') } - before do - allow(app).to receive(:call).and_raise(StandardError) - allow(described_class).to receive(:rack_response_count).and_return(rack_response_count) - end - it 'increments exceptions count' do expect(described_class).to receive_message_chain(:rack_uncaught_errors_count, :increment) |