Commit b2afa834 authored by charlie ablett's avatar charlie ablett

Apply reviewer feedback

parent 8e73c5a1
......@@ -110,16 +110,16 @@ The following metrics are available:
| `auto_devops_pipelines_completed_total` | Counter | 12.7 | Counter of completed Auto DevOps pipelines, labeled by status | |
| `gitlab_metrics_dashboard_processing_time_ms` | Summary | 12.10 | Metrics dashboard processing time in milliseconds | service, stages |
| `action_cable_active_connections` | Gauge | 13.4 | Number of ActionCable WS clients currently connected | `server_mode` |
| `action_cable_broadcasts_total` | Counter | 13.10 | The number of ActionCable broadcasts emitted | `server_mode` |
| `action_cable_pool_min_size` | Gauge | 13.4 | Minimum number of worker threads in ActionCable thread pool | `server_mode` |
| `action_cable_pool_max_size` | Gauge | 13.4 | Maximum number of worker threads in ActionCable thread pool | `server_mode` |
| `action_cable_pool_current_size` | Gauge | 13.4 | Current number of worker threads in ActionCable thread pool | `server_mode` |
| `action_cable_pool_largest_size` | Gauge | 13.4 | Largest number of worker threads observed so far in ActionCable thread pool | `server_mode` |
| `action_cable_pool_pending_tasks` | Gauge | 13.4 | Number of tasks waiting to be executed in ActionCable thread pool | `server_mode` |
| `action_cable_pool_tasks_total` | Gauge | 13.4 | Total number of tasks executed in ActionCable thread pool | `server_mode` |
| `action_cable_single_client_transmissions_total` | Counter | 13.10 | The number of ActionCable messages transmitted to any client in any channel | `server_mode` |
| `action_cable_subscription_confirmations_total` | Counter | 13.10 | The number of ActionCable subscriptions from clients confirmed | `server_mode` |
| `action_cable_subscription_rejections_total` | Counter | 13.10 | The number of ActionCable subscriptions from clients rejected | `server_mode` |
| `action_cable_single_client_transmissions_total` | Counter | 13.10 | The number of ActionCable messages transmitted to any client in any channel | `server_mode` |
| `action_cable_broadcasts_total` | Counter | 13.10 | The number of ActionCable broadcasts emitted | `server_mode` |
| `gitlab_issuable_fast_count_by_state_total` | Counter | 13.5 | Total number of row count operations on issue/merge request list pages | |
| `gitlab_issuable_fast_count_by_state_failures_total` | Counter | 13.5 | Number of soft-failed row count operations on issue/merge request list pages | |
| `gitlab_external_http_total` | Counter | 13.8 | Total number of HTTP calls to external systems | `controller`, `action` |
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe Gitlab::Metrics::Subscribers::ActionCable, :request_store do
let(:subscriber) { described_class.new }
let(:counter) { double(:counter) }
let(:data) { { data: { event: 'updated' } } }
let(:channel_class) { 'IssuesChannel' }
let(:event) do
......@@ -26,9 +27,11 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActionCable, :request_store do
end
it 'tracks the transmit event' do
expect(::Gitlab::Metrics).to receive(:counter)
.with(Gitlab::Metrics::Subscribers::ActionCable::SINGLE_CLIENT_TRANSMISSION, /transmit/)
.and_call_original
allow(::Gitlab::Metrics).to receive(:counter).with(
:action_cable_single_client_transmissions_total, /transmit/
).and_return(counter)
expect(counter).to receive(:increment)
subscriber.transmit(event)
end
......@@ -51,9 +54,11 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActionCable, :request_store do
end
it 'tracks the broadcast event' do
expect(::Gitlab::Metrics).to receive(:counter)
.with(Gitlab::Metrics::Subscribers::ActionCable::BROADCAST, /broadcast/)
.and_call_original
allow(::Gitlab::Metrics).to receive(:counter).with(
:action_cable_broadcasts_total, /broadcast/
).and_return(counter)
expect(counter).to receive(:increment)
subscriber.broadcast(event)
end
......@@ -68,10 +73,12 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActionCable, :request_store do
}
end
it 'tracks the transmit event' do
expect(::Gitlab::Metrics).to receive(:counter)
.with(Gitlab::Metrics::Subscribers::ActionCable::TRANSMIT_SUBSCRIPTION_CONFIRMATION, /confirm/)
.and_call_original
it 'tracks the subscription confirmation event' do
allow(::Gitlab::Metrics).to receive(:counter).with(
:action_cable_subscription_confirmations_total, /confirm/
).and_return(counter)
expect(counter).to receive(:increment)
subscriber.transmit_subscription_confirmation(event)
end
......@@ -86,10 +93,12 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActionCable, :request_store do
}
end
it 'tracks the transmit event' do
expect(::Gitlab::Metrics).to receive(:counter)
.with(Gitlab::Metrics::Subscribers::ActionCable::TRANSMIT_SUBSCRIPTION_REJECTION, /reject/)
.and_call_original
it 'tracks the subscription rejection event' do
allow(::Gitlab::Metrics).to receive(:counter).with(
:action_cable_subscription_rejections_total, /reject/
).and_return(counter)
expect(counter).to receive(:increment)
subscriber.transmit_subscription_rejection(event)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment