Commit 0f977057 authored by Max Woolf's avatar Max Woolf Committed by Alex Pooley

Add external status checks total to ping

Adds the total number of external status checks
for an instance to the Service Ping

Changelog: added
EE: true
parent 0f1d1f62
---
key_path: counts.external_status_checks
description: Total number of external status checks
product_section: dev
product_stage: manage
product_group: compliance
product_category: "Compliance Management"
value_type: number
status: active
milestone: "14.9"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82416
time_frame: all
data_source: database
data_category: optional
instrumentation_class: CountExternalStatusChecksMetric
distribution:
- ee
tier:
- ultimate
# frozen_string_literal: true
module Gitlab
module Usage
module Metrics
module Instrumentations
class CountExternalStatusChecksMetric < DatabaseMetric
operation :count
relation do
::MergeRequests::ExternalStatusCheck
end
end
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::CountExternalStatusChecksMetric do
let_it_be(:checks) { create_list(:external_status_check, 3) }
it_behaves_like 'a correct instrumented metric value and query', { time_frame: 'all', data_source: 'database' } do
let(:expected_value) { 3 }
let(:expected_query) { "SELECT COUNT(\"external_status_checks\".\"id\") FROM \"external_status_checks\"" }
end
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