Metric
setRepositoryMetricThreshold
Mutation:setRepositoryMetricThreshold
Update the threshold for a metric in a repository.
Arguments
Field | Type | Description |
---|---|---|
input | SetRepositoryMetricThresholdInput! | Input for SetRepositoryMetricThreshold mutation. |
Sample Request
mutation ($input: SetRepositoryMetricThresholdInput!) {
setRepositoryMetricThreshold(input: $input) {
ok
}
}
variables = {
"input": {
"repositoryId": "VHJhbnNmb3JtZXI6bGp6a3d6",
"metricShortcode": "LCV",
"metricKey": "PYTHON",
"thresholdValue": 90
}
}
Sample Response
{
"setRepositoryMetricThreshold": {
"ok": true
}
}
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 the RepositoryMetric
.
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 a RepositoryMetricItem
.
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 a MetricValue
and its cursor.
Field | Type | Description |
---|---|---|
node | MetricValue | The item at the end of the edge. |
cursor | String! | A cursor for use in pagination. |
SetRepositoryMetricThresholdInput
Input for the setRepositoryMetricThreshold
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. |
thresholdValue | Int | Threshold value to set. Setting to null removes the threshold. |
Updated over 1 year ago