setRepositoryMetricThreshold
Mutation:setRepositoryMetricThreshold Update the threshold for a metric in a repository.
Arguments
| Field | Type | Description |
|---|---|---|
| input | SetRepositoryMetricThresholdInput! | Input for SetRepositoryMetricThreshold mutation. |
Sample Request
Sample Response
Objects
Metric
A metric tracked by an analyzer.| Field | Type | Description |
|---|---|---|
| id | ID! | The ID of the object. |
| name | String! | The metric’s name. |
| shortcode | MetricShortcode! | The metric’s unique identifier. |
| description | String! | The metric’s description in markdown format. |
| positiveDirection | Direction! | Direction which can be considered positive for the metric. |
| unit | String | Unit suffix to apply to the metric value. |
| minValueAllowed | Int | Lower bound for the metric value. |
| maxValueAllowed | Int | Upper bound for the metric value. |
RepositoryMetric
A Metric’s manifestation specific to a repository.| Field | Type | Description |
|---|---|---|
| name | String! | The metric’s name. |
| shortcode | MetricShortcode! | The metric’s unique identifier. |
| description | String! | The metric’s description in markdown format. |
| positiveDirection | Direction! | Direction which can be considered positive for the metric. |
| unit | String | Unit suffix to apply to the metric value. |
| minValueAllowed | Int | Lower bound for the metric value. |
| maxValueAllowed | Int | Upper bound for the metric value. |
| isReported | Boolean! | Whether this metric is enabled for reporting in the repository. |
| isThresholdEnforced | Boolean! | Whether to fail checks when thresholds are not met for the metric in the repository. |
| items | [RepositoryMetricItem!] | Items in the repository metric. |
RepositoryMetricItem
An item in theRepositoryMetric.
| Field | Type | Description |
|---|---|---|
| id | ID! | The ID of the object. |
| key | MetricKey! | Distinct key representing the metric in the repository. |
| threshold | Int | Threshold value for the metric, customizable by the user. Null if no threshold is set. |
| latestValue | Float | Latest value captured for this metric on the repository’s default branch. |
| latestValueDisplay | String | Latest value captured for this metric on the repository’s default branch. Suffixed with the unit and returned as a human-readable string. |
| thresholdStatus | MetricThresholdStatus | The status of the threshold condition for the latest metric value on the repository’s default branch. |
| values | MetricValueConnection | All values captured for this metric in the repository or check. |
| commitOidIn | [String] | Commit OIDs to filter the metric values on. Applicable only for fetching metrics inside a repository but not check. |
| offset | Int | |
| before | String | |
| after | String | |
| first | Int | |
| last | Int |
MetricValue
An individual value captured for aRepositoryMetricItem.
| Field | Type | Description |
|---|---|---|
| id | ID! | The ID of the object. |
| value | Float! | Metric value reported by the analyzer. |
| valueDisplay | String! | Value suffixed with the unit of the metric. |
| threshold | Int | Threshold value for the metric when this value was reported. Null if no threshold was set. |
| thresholdStatus | MetricThresholdStatus | The status of the threshold condition for the metric value. |
| commitOid | String | Commit SHA for which this value was recorded on the repository. |
| createdAt | DateTime! | The time at which the value was captured. |
MetricValueConnection
| Field | Type | Description |
|---|---|---|
| pageInfo | PageInfo! | Pagination data for this connection. |
| edges | [MetricValueEdge]! | Contains the nodes in this connection. |
| totalCount | Int |
MetricValueEdge
A Relay edge containing aMetricValue and its cursor.
| Field | Type | Description |
|---|---|---|
| node | MetricValue | The item at the end of the edge. |
| cursor | String! | A cursor for use in pagination. |
MetricSetting
Configuration for aMetric in a Repository.
| Field | Type | Description |
|---|---|---|
| metricShortcode | MetricShortcode! | A `MetricShortcode`. |
| isReported | Boolean! | Whether the metric is enabled for reporting in the repository. |
| isThresholdEnforced | Boolean! | Whether to fail checks when the metric’s thresholds are not met in the repository. |
SetRepositoryMetricThresholdInput
Input for thesetRepositoryMetricThreshold mutation.
| Field | Type | Description |
|---|---|---|
| repositoryId | ID! | GraphQL node ID of the repository. |
| metricShortcode | MetricShortcode! | Metric shortcode to update the threshold for. |
| metricKey | MetricKey! | The key of the metric you want to update the threshold for. |