This repository has been archived on 2023-04-02. You can view files and clone it, but cannot push or open issues or pull requests.
gitops-tbrnt/monitoring/vendor/grafonnet/gauge.libsonnet

33 lines
725 B
Plaintext

{
new(
title,
datasource=null,
calc='mean',
description='',
height=null,
transparent=null,
)::
{
[if description != '' then 'description']: description,
[if height != null then 'height']: height,
[if transparent != null then 'transparent']: transparent,
title: title,
type: 'gauge',
datasource: datasource,
options: {
fieldOptions: {
calcs: [
calc,
],
},
},
_nextTarget:: 0,
addTarget(target):: self {
local nextTarget = super._nextTarget,
_nextTarget: nextTarget + 1,
targets+: [target { refId: std.char(std.codepoint('A') + nextTarget) }],
},
},
}