Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function newPanel(params: PanelParams) {
const pan = new Grafana.Panels.Graph({
title: params.title,
span: 6,
datasource: 'default',
});
// Have to add this after to avoid grafana-dash-gen from forcing the target
// into a Graphite format
pan.state.targets = params.targets;
return pan;
}
function createBootstrapRow() {
var row = new grafana.Row();
row.state.title = 'BOOTSTRAP';
row.state.showTitle = true;
row.addPanel(new grafana.Panels.Graph({
title: 'Join Times',
span: 12,
targets: [
/* eslint-disable max-len */
new grafana.Target(getTarget('bootstrap.join-p95'))
.percentileOfSeries(50).alias('p95')
/* eslint-enable max-len */
],
legend: {
show: false
}
}));
return row;
}
function newPanel(params: PanelParams) {
const pan = new Grafana.Panels.Graph({
title: params.title,
span: 6,
datasource: 'default',
description: params.description ?? '',
});
// Have to add this after to avoid grafana-dash-gen from forcing the target
// into a Graphite format
pan.state.targets = params.targets;
// "short" is the default unit for grafana (no unit)
pan.state.y_formats[0] = params.unit ?? 'short';
// yMin should be 0 at minimum unless otherwise specified.
// null is used to indicate 'auto' in grafana
if (params.yMin === null) {
pan.state.grid.leftMin = null;
function createGossipRow() {
var row = new grafana.Row();
row.state.title = 'GOSSIP';
row.state.showTitle = true;
row.addPanel(new grafana.Panels.SingleStat({
title: 'Cluster Size',
span: 3,
targets: [
new grafana.Target(getTarget('gossip.ping-send'))
.countSeries().alias('total')
],
legend: {
show: false
}
}));
row.addPanel(lineGraph({
title: 'Ping TX/sec',
span: 3,
targets: [
new grafana.Target(getTarget('gossip.ping-send'))
function lineGraph(opts) {
var graph = new grafana.Panels.Graph(opts);
graph.state.fill = 0;
return graph;
}