Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
}
}));
function createMembershipRow() {
var row = new grafana.Row();
row.state.title = 'MEMBERSHIP';
row.state.showTitle = true;
row.addPanel(new grafana.Panels.Graph({
title: 'Full-syncs',
span: 4,
targets: [
/* eslint-disable max-len */
new grafana.Target(getTarget("membership.full-sync"))
.sumSeries().alias('total')
/* eslint-enable max-len */
]
}));
row.addPanel(lineGraph({
title: 'Updates',
function createDisseminationRow() {
var row = new grafana.Row();
row.state.title = 'DISSEMINATION';
row.state.showTitle = true;
row.addPanel(new grafana.Panels.SingleStat({
title: 'Max Piggyback',
span: 4,
targets: [
/* eslint-disable max-len */
new grafana.Target(getTarget('dissemination.max-piggyback'))
.maxSeries().alias('total')
/* eslint-enable max-len */
]
}));
return row;
}
const rows = dbdata.rows.map(conf => {
const row = new Grafana.Row({title: conf.title});
conf.panels.forEach(panel => row.addPanel(newPanel(panel)));
return row;
});
const db = new Grafana.Dashboard({
export function SubscribersDashboard() {
const row = new Grafana.Row({title: ''});
SubscribersPanels.forEach(conf => {
row.addPanel(newPanel(conf));
});
const db = new Grafana.Dashboard({
schemaVersion: 6,
title: 'CWF - Subscribers',
templating: [imsiTemplate()],
rows: [row],
editable: false,
});
db.state.editable = false;
db.state.description =
'Do not edit: edits will be overwritten. Save this dashboard under another name to copy and edit.';
return db;
}
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({
export function InternalDashboard() {
const row = new Grafana.Row({title: ''});
InternalPanels.forEach(conf => {
row.addPanel(newPanel(conf));
});
const db = new Grafana.Dashboard({
schemaVersion: 6,
title: 'Internal',
templating: [networkTemplate(), gatewayTemplate()],
rows: [row],
});
db.state.editable = false;
db.state.description =
'Metrics relevant to the internals of gateways. Do not edit: edits will be overwritten. Save this dashboard under another name to copy and edit.';
return db;
}
export function NetworksDashboard() {
const row = new Grafana.Row({title: ''});
NetworkPanels.forEach(conf => {
row.addPanel(newPanel(conf));
});
const db = new Grafana.Dashboard({
schemaVersion: 6,
title: 'Networks',
templating: [networkTemplate()],
rows: [row],
editable: false,
});
db.state.editable = false;
db.state.description =
'Metrics relevant to the whole network. Do not edit: edits will be overwritten. Save this dashboard under another name to copy and edit.';
return db;
}
function createSystemRow() {
var row = new grafana.Row();
row.state.title = 'SYSTEM';
row.state.showTitle = true;
row.addPanel(lineGraph({
title: 'Process CPU',
span: 4,
targets: [
new grafana.Target(getTarget('system.process-cpu'))
.derivative().scale(1.6666666667).removeBelowValue(0)
.alias('percent')
],
legend: {
show: false
}
}));
export function TemplateDashboard() {
const row = new Grafana.Row({title: ''});
row.addPanel(
newPanel({
title: 'Variable Demo',
targets: [
{expr: `cpu_percent{networkID=~"$networkID",gatewayID=~"$gatewayID"}`},
],
}),
);
const db = new Grafana.Dashboard({
schemaVersion: 6,
title: 'Template',
templating: [networkTemplate(), gatewayTemplate()],
rows: [row],
});
db.state.editable = true;
db.state.description =