metrics
default

Calculate metrics on deployments submitted by `/events/deployments`.

Changed on
post/metrics/deployments

Request

Request body

metricsDeploymentMetricID[] required

Requested metric identifiers.

date_fromstring date required

Date from when to start measuring the metrics.

date_tostring date required

Date until which to measure the metrics.

timezoneinteger

Local time zone offset in minutes, used to adjust date_from and date_to.

granularitiesGranularity[] required

The splits of the specified time range.

quantilesnumber[]

Cut the distributions at certain quantiles. The default values are [0, 1] which means no cutting.

accountinteger required

Session account ID.

Example request

{
  "for": [
    {
      "repositories": [
        "github.com/athenianco/athenian-webapp",
        "github.com/athenianco/athenian-api"
      ],
      "withgroups": [
        {
          "pr_author": [
            "github.com/se7entyse7en",
            "github.com/vmarkovtsev"
          ]
        }
      ],
      "jira": {
        "labels_include": [
          "bug"
        ]
      }
    }
  ],
  "metrics": [
    "dep-duration-successful",
    "dep-success-ratio"
  ],
  "date_from": "2021-07-20",
  "date_to": "2021-10-07",
  "granularities": [
    "all",
    "2 week"
  ],
  "account": 1
}

Response

Calculated metrics.

metricsDeploymentMetricID[] required
granularitystring required

How often the metrics are reported. The value must satisfy the following regular expression: /^all|(([1-9]\d* )?(aligned )?(day|week|month|year))$/. "all" produces a single interval [date_from, date_to]. "aligned week/month/year" produces intervals cut by calendar week/month/year borders, for example, when date_from is 2020-01-15 and date_to is 2020-03-10, the intervals will be 2020-01-15 - 2020-02-01 - 2020-03-01 - 2020-03-10.

Example response

[
  {
    "for": {
      "repositories": [
        "github.com/athenianco/athenian-webapp",
        "github.com/athenianco/athenian-api"
      ],
      "with": {
        "pr_author": [
          "github.com/se7entyse7en",
          "github.com/vmarkovtsev"
        ]
      }
    },
    "metrics": [
      "dep-duration-successful",
      "dep-success-ratio"
    ],
    "granularity": "all",
    "values": [
      {
        "date": "2020-07-20",
        "values": [
          "600s",
          0.91
        ],
        "confidence_mins": [
          "550s",
          null
        ],
        "confidence_maxs": [
          "630s",
          null
        ],
        "confidence_scores": [
          84,
          null
        ]
      }
    ]
  }
]

Changes

    • warning

      added the new dep-change-failure-count enum value to the // response property for the response status

    • warning

      added the new dep-change-failure-ratio enum value to the // response property for the response status

    • info

      added the new dep-change-failure-count enum value to the request property /

    • info

      added the new dep-change-failure-ratio enum value to the request property /

    • info

      added the new optional request property ///

    • info

      added the optional property /// to the response with the status