Skip to content

Usage data for customized VSM stages

Adam Hegyi requested to merge 210369-usage-ping-for-customized-vsm into master

What does this MR do?

Adding custom Value Stream Management stages count (without time period) to usage data.

Queries

BatchCount (Min)

Result  (cost=1.35..1.36 rows=1 width=8) (actual time=0.134..0.134 rows=1 loops=1)
   Buffers: shared hit=2 read=1
   I/O Timings: read=0.059
   InitPlan 1 (returns $0)
     ->  Limit  (cost=0.13..1.35 rows=1 width=8) (actual time=0.107..0.107 rows=1 loops=1)
           Buffers: shared hit=2 read=1
           I/O Timings: read=0.059
           ->  Index Only Scan using index_analytics_cycle_analytics_group_stages_custom_only on public.analytics_cycle_analytics_group_stages  (cost=0.13..6.22 rows=5 width=8) (actual time=0.106..0.106 rows=1 loops=1)
                 Index Cond: (analytics_cycle_analytics_group_stages.id IS NOT NULL)
                 Heap Fetches: 1
                 Buffers: shared hit=2 read=1
                 I/O Timings: read=0.059
SELECT MIN("analytics_cycle_analytics_group_stages"."id") FROM "analytics_cycle_analytics_group_stages" WHERE "analytics_cycle_analytics_group_stages"."custom" = TRUE
BatchCount (Max)

Result  (cost=1.35..1.36 rows=1 width=8) (actual time=0.025..0.026 rows=1 loops=1)
   Buffers: shared hit=3
   InitPlan 1 (returns $0)
     ->  Limit  (cost=0.13..1.35 rows=1 width=8) (actual time=0.021..0.021 rows=1 loops=1)
           Buffers: shared hit=3
           ->  Index Only Scan using index_analytics_cycle_analytics_group_stages_custom_only on public.analytics_cycle_analytics_group_stages  (cost=0.13..6.22 rows=5 width=8) (actual time=0.020..0.020 rows=1 loops=1)
                 Index Cond: (analytics_cycle_analytics_group_stages.id IS NOT NULL)
                 Heap Fetches: 1
                 Buffers: shared hit=3
SELECT MAX("analytics_cycle_analytics_group_stages"."id") FROM "analytics_cycle_analytics_group_stages" WHERE "analytics_cycle_analytics_group_stages"."custom" = TRUE

Note: We have very small amount of records so the planner picks seq scan on the table at the moment:

BatchCount (Count)

 Aggregate  (cost=4.61..4.62 rows=1 width=8) (actual time=0.056..0.056 rows=1 loops=1)
   Buffers: shared hit=1
   ->  Seq Scan on public.analytics_cycle_analytics_group_stages  (cost=0.00..4.60 rows=4 width=8) (actual time=0.012..0.016 rows=5 loops=1)
         Filter: (analytics_cycle_analytics_group_stages.custom AND (analytics_cycle_analytics_group_stages.id >= 8) AND (analytics_cycle_analytics_group_stages.id <= 100007))
         Rows Removed by Filter: 35
         Buffers: shared hit=1
SELECT COUNT("analytics_cycle_analytics_group_stages"."id") FROM "analytics_cycle_analytics_group_stages" WHERE "analytics_cycle_analytics_group_stages"."custom" = TRUE AND "analytics_cycle_analytics_group_stages"."id" BETWEEN 0 AND 99999

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #210369 (closed)

Edited by Alper Akgun

Merge request reports