Skip to content

Add performance analytics metrics api

Linjie Zhang请求将performance-api合并到main-jh

What does this MR do and why?

Add performance analytics metrics api for group level and project level.

note: This MR is behind performance_analytics feature flag, which is disabled by default.

related to #1884 (closed)

How to set up and validate locally

  1. In rails console enable feature flag
    Feature.enable(:performance_analytics)
  2. fetch api through curl
    > # Daily
    > curl -H 'Private-token: XXX' "http://local.gitlab.test:3000/api/v4/groups/134/performance_analytics/metrics?metric=issue_created&start_date=2022-09-01&end_date=2022-09-02"
    [{"date":"2022-09-01","value":1},{"date":"2022-09-02","value":0}]
    
    > # Monthly
    > curl -H 'Private-token: XXX' "http://local.gitlab.test:3000/api/v4/groups/134/performance_analytics/metrics?metric=issue_created&start_date=2022-09-01&end_date=2022-10-30&interval=monthly"
    [{"date":"2022-09","value":1},{"date":"2022-10","value":0}]
    
    > # All
    > curl -H 'Private-token: XXX' "http://local.gitlab.test:3000/api/v4/groups/134/performance_analytics/metrics?metric=issue_created&start_date=2022-09-01&end_date=2022-10-30&interval=all"
    {"value":1}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Linjie Zhang 编辑于

合并请求报告

加载中