Add scaffolding for database metrics in CLI
What does this MR do and why?
Related to #464066 (closed)
Related to #569189 (closed)
Add scaffolding for database metrics in CLI
This MR sketches out the architecture to be used when creating database metrics with internal events CLI. This is just a first step towards actually adding database metrics creation to our CLI.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Make sure that old CLI database metric creation flow works as before:
scripts/internal_events/cli.rb->new metric->database metric. This should show a message about db metrics not being supported and end the flow. - After checking that, restart CLI with an ENV variable:
ENABLE_DATABASE_METRIC=true scripts/internal_events/cli.rb - Go into
metric creation->database metricagain - Choose a
description,product groupand any other attributes required by the flow. - Accept file creation. This should create a file, filling out all the other metric fields with default values defined in this MR.
- Make sure that the newly added metric file works correctly with Service Ping: open a new rails console and execute
require_relative 'spec/support/helpers/service_ping_helpers.rb'; {'28d': ServicePingHelpers.get_current_usage_metric_value('issues_count_monthly'), '7d': ServicePingHelpers.get_current_usage_metric_value('issues_count_weekly')}. These should report values equal to the amount of issues you created in GDK in the past week/month. In case the numbers look wrong, try to comment out the cache line in the metric classreload!the rails console and re-calculate the metrics.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Michał Wielich