687 lines
19 KiB
JavaScript
687 lines
19 KiB
JavaScript
/**
|
|
* Extended host chart catalog (deep /proc + /sys coverage).
|
|
* Merged into STATIC_CHART_DEFS by shared/metrics.js.
|
|
*/
|
|
|
|
/** @typedef {import('./metrics.js').ChartDef} ChartDef */
|
|
|
|
/** @type {ChartDef[]} */
|
|
export const DEEP_STATIC_CHARTS = [
|
|
// ── Memory deep ───────────────────────────────────────────
|
|
{
|
|
id: 'mem.zswap',
|
|
name: 'mem.zswap',
|
|
context: 'mem.zswap',
|
|
title: 'Zswap usage',
|
|
units: 'MiB',
|
|
family: 'zswap',
|
|
chartType: 'stacked',
|
|
priority: 248,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'in_ram', name: 'in_ram', algorithm: 'absolute' },
|
|
{ id: 'on_disk', name: 'on_disk', algorithm: 'absolute' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.hwcorrupt',
|
|
name: 'mem.hwcorrupt',
|
|
context: 'mem.hwcorrupt',
|
|
title: 'Hardware corrupted memory',
|
|
units: 'MiB',
|
|
family: 'hardware',
|
|
chartType: 'line',
|
|
priority: 249,
|
|
plugin: 'proc',
|
|
dimensions: [{ id: 'HardwareCorrupted', name: 'HardwareCorrupted', algorithm: 'absolute' }],
|
|
},
|
|
{
|
|
id: 'mem.hugepages',
|
|
name: 'mem.hugepages',
|
|
context: 'mem.hugepages',
|
|
title: 'HugePages',
|
|
units: 'MiB',
|
|
family: 'hugepages',
|
|
chartType: 'stacked',
|
|
priority: 252,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'free', name: 'free', algorithm: 'absolute' },
|
|
{ id: 'used', name: 'used', algorithm: 'absolute' },
|
|
{ id: 'surplus', name: 'surplus', algorithm: 'absolute' },
|
|
{ id: 'reserved', name: 'reserved', algorithm: 'absolute' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.thp',
|
|
name: 'mem.thp',
|
|
context: 'mem.thp',
|
|
title: 'Transparent HugePages',
|
|
units: 'MiB',
|
|
family: 'thp',
|
|
chartType: 'stacked',
|
|
priority: 253,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'anonymous', name: 'anonymous', algorithm: 'absolute' },
|
|
{ id: 'shmem', name: 'shmem', algorithm: 'absolute' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.thp_details',
|
|
name: 'mem.thp_details',
|
|
context: 'mem.thp_details',
|
|
title: 'Transparent HugePages details',
|
|
units: 'MiB',
|
|
family: 'thp',
|
|
chartType: 'line',
|
|
priority: 254,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'ShmemPmdMapped', name: 'ShmemPmdMapped', algorithm: 'absolute' },
|
|
{ id: 'FileHugePages', name: 'FileHugePages', algorithm: 'absolute' },
|
|
{ id: 'FilePmdMapped', name: 'FilePmdMapped', algorithm: 'absolute' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.reclaiming',
|
|
name: 'mem.reclaiming',
|
|
context: 'mem.reclaiming',
|
|
title: 'Memory reclaiming (LRU)',
|
|
units: 'MiB',
|
|
family: 'reclaiming',
|
|
chartType: 'stacked',
|
|
priority: 255,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'Active', name: 'Active', algorithm: 'absolute' },
|
|
{ id: 'Inactive', name: 'Inactive', algorithm: 'absolute' },
|
|
{ id: 'Active_anon', name: 'Active_anon', algorithm: 'absolute' },
|
|
{ id: 'Inactive_anon', name: 'Inactive_anon', algorithm: 'absolute' },
|
|
{ id: 'Active_file', name: 'Active_file', algorithm: 'absolute' },
|
|
{ id: 'Inactive_file', name: 'Inactive_file', algorithm: 'absolute' },
|
|
{ id: 'Unevictable', name: 'Unevictable', algorithm: 'absolute' },
|
|
{ id: 'Mlocked', name: 'Mlocked', algorithm: 'absolute' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.oom_kill',
|
|
name: 'mem.oom_kill',
|
|
context: 'mem.oom_kill',
|
|
title: 'OOM kills',
|
|
units: 'kills/s',
|
|
family: 'oom',
|
|
chartType: 'line',
|
|
priority: 256,
|
|
plugin: 'proc',
|
|
dimensions: [{ id: 'kills', name: 'kills', algorithm: 'incremental' }],
|
|
},
|
|
{
|
|
id: 'mem.balloon',
|
|
name: 'mem.balloon',
|
|
context: 'mem.balloon',
|
|
title: 'Memory balloon',
|
|
units: 'KiB/s',
|
|
family: 'balloon',
|
|
chartType: 'line',
|
|
priority: 257,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'inflate', name: 'inflate', algorithm: 'incremental' },
|
|
{ id: 'deflate', name: 'deflate', algorithm: 'incremental' },
|
|
{ id: 'migrate', name: 'migrate', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.zswapio',
|
|
name: 'mem.zswapio',
|
|
context: 'mem.zswapio',
|
|
title: 'Zswap I/O',
|
|
units: 'KiB/s',
|
|
family: 'zswap',
|
|
chartType: 'area',
|
|
priority: 258,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'in', name: 'in', algorithm: 'incremental' },
|
|
{ id: 'out', name: 'out', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.numa',
|
|
name: 'mem.numa',
|
|
context: 'mem.numa',
|
|
title: 'NUMA events',
|
|
units: 'events/s',
|
|
family: 'numa',
|
|
chartType: 'line',
|
|
priority: 259,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'local', name: 'local', algorithm: 'incremental' },
|
|
{ id: 'foreign', name: 'foreign', algorithm: 'incremental' },
|
|
{ id: 'interleave', name: 'interleave', algorithm: 'incremental' },
|
|
{ id: 'other', name: 'other', algorithm: 'incremental' },
|
|
{ id: 'pte_updates', name: 'pte_updates', algorithm: 'incremental' },
|
|
{ id: 'pages_migrated', name: 'pages_migrated', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.thp_faults',
|
|
name: 'mem.thp_faults',
|
|
context: 'mem.thp_faults',
|
|
title: 'THP fault events',
|
|
units: 'events/s',
|
|
family: 'thp',
|
|
chartType: 'line',
|
|
priority: 260,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'alloc', name: 'alloc', algorithm: 'incremental' },
|
|
{ id: 'fallback', name: 'fallback', algorithm: 'incremental' },
|
|
{ id: 'fallback_charge', name: 'fallback_charge', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.thp_split',
|
|
name: 'mem.thp_split',
|
|
context: 'mem.thp_split',
|
|
title: 'THP split events',
|
|
units: 'events/s',
|
|
family: 'thp',
|
|
chartType: 'line',
|
|
priority: 261,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'split', name: 'split', algorithm: 'incremental' },
|
|
{ id: 'failed', name: 'failed', algorithm: 'incremental' },
|
|
{ id: 'split_pmd', name: 'split_pmd', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.ksm',
|
|
name: 'mem.ksm',
|
|
context: 'mem.ksm',
|
|
title: 'Kernel Same-page Merging',
|
|
units: 'MiB',
|
|
family: 'ksm',
|
|
chartType: 'stacked',
|
|
priority: 262,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'shared', name: 'shared', algorithm: 'absolute' },
|
|
{ id: 'sharing', name: 'sharing', algorithm: 'absolute' },
|
|
{ id: 'unshared', name: 'unshared', algorithm: 'absolute' },
|
|
{ id: 'volatile', name: 'volatile', algorithm: 'absolute' },
|
|
],
|
|
},
|
|
{
|
|
id: 'mem.ksm_cow',
|
|
name: 'mem.ksm_cow',
|
|
context: 'mem.ksm_cow',
|
|
title: 'KSM copy-on-write',
|
|
units: 'KiB/s',
|
|
family: 'ksm',
|
|
chartType: 'line',
|
|
priority: 263,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'swapin', name: 'swapin', algorithm: 'incremental' },
|
|
{ id: 'write', name: 'write', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
|
|
// ── PSI full + stall ──────────────────────────────────────
|
|
{
|
|
id: 'system.cpu_full_pressure',
|
|
name: 'system.cpu_full_pressure',
|
|
context: 'system.cpu_full_pressure',
|
|
title: 'CPU Full Pressure',
|
|
units: 'percentage',
|
|
family: 'pressure',
|
|
chartType: 'line',
|
|
priority: 801,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'full10', name: 'full10', algorithm: 'absolute' },
|
|
{ id: 'full60', name: 'full60', algorithm: 'absolute' },
|
|
{ id: 'full300', name: 'full300', algorithm: 'absolute' },
|
|
],
|
|
},
|
|
{
|
|
id: 'system.memory_full_pressure',
|
|
name: 'system.memory_full_pressure',
|
|
context: 'system.memory_full_pressure',
|
|
title: 'Memory Full Pressure',
|
|
units: 'percentage',
|
|
family: 'pressure',
|
|
chartType: 'line',
|
|
priority: 811,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'full10', name: 'full10', algorithm: 'absolute' },
|
|
{ id: 'full60', name: 'full60', algorithm: 'absolute' },
|
|
{ id: 'full300', name: 'full300', algorithm: 'absolute' },
|
|
],
|
|
},
|
|
{
|
|
id: 'system.io_full_pressure',
|
|
name: 'system.io_full_pressure',
|
|
context: 'system.io_full_pressure',
|
|
title: 'I/O Full Pressure',
|
|
units: 'percentage',
|
|
family: 'pressure',
|
|
chartType: 'line',
|
|
priority: 821,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'full10', name: 'full10', algorithm: 'absolute' },
|
|
{ id: 'full60', name: 'full60', algorithm: 'absolute' },
|
|
{ id: 'full300', name: 'full300', algorithm: 'absolute' },
|
|
],
|
|
},
|
|
|
|
// ── Softnet / ICMP / TCP advanced ─────────────────────────
|
|
{
|
|
id: 'system.softnet_stat',
|
|
name: 'system.softnet_stat',
|
|
context: 'system.softnet_stat',
|
|
title: 'Softnet statistics',
|
|
units: 'events/s',
|
|
family: 'softnet',
|
|
chartType: 'line',
|
|
priority: 780,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'processed', name: 'processed', algorithm: 'incremental' },
|
|
{ id: 'dropped', name: 'dropped', algorithm: 'incremental' },
|
|
{ id: 'squeezed', name: 'squeezed', algorithm: 'incremental' },
|
|
{ id: 'received_rps', name: 'received_rps', algorithm: 'incremental' },
|
|
{ id: 'flow_limit', name: 'flow_limit', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ipv4.icmp',
|
|
name: 'ipv4.icmp',
|
|
context: 'ipv4.icmp',
|
|
title: 'IPv4 ICMP messages',
|
|
units: 'messages/s',
|
|
family: 'icmp',
|
|
chartType: 'line',
|
|
priority: 755,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'received', name: 'received', algorithm: 'incremental' },
|
|
{ id: 'sent', name: 'sent', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ipv4.icmp_errors',
|
|
name: 'ipv4.icmp_errors',
|
|
context: 'ipv4.icmp_errors',
|
|
title: 'IPv4 ICMP errors',
|
|
units: 'messages/s',
|
|
family: 'icmp',
|
|
chartType: 'line',
|
|
priority: 756,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'InErrors', name: 'InErrors', algorithm: 'incremental' },
|
|
{ id: 'OutErrors', name: 'OutErrors', algorithm: 'incremental' },
|
|
{ id: 'InCsumErrors', name: 'InCsumErrors', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ip.tcpsyncookies',
|
|
name: 'ip.tcpsyncookies',
|
|
context: 'ip.tcpsyncookies',
|
|
title: 'TCP SYN cookies',
|
|
units: 'cookies/s',
|
|
family: 'tcp',
|
|
chartType: 'line',
|
|
priority: 730,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'received', name: 'received', algorithm: 'incremental' },
|
|
{ id: 'sent', name: 'sent', algorithm: 'incremental' },
|
|
{ id: 'failed', name: 'failed', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ip.tcp_syn_queue',
|
|
name: 'ip.tcp_syn_queue',
|
|
context: 'ip.tcp_syn_queue',
|
|
title: 'TCP SYN queue',
|
|
units: 'packets/s',
|
|
family: 'tcp',
|
|
chartType: 'line',
|
|
priority: 731,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'drops', name: 'drops', algorithm: 'incremental' },
|
|
{ id: 'cookies', name: 'cookies', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ip.tcp_accept_queue',
|
|
name: 'ip.tcp_accept_queue',
|
|
context: 'ip.tcp_accept_queue',
|
|
title: 'TCP accept queue',
|
|
units: 'events/s',
|
|
family: 'tcp',
|
|
chartType: 'line',
|
|
priority: 732,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'overflows', name: 'overflows', algorithm: 'incremental' },
|
|
{ id: 'drops', name: 'drops', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ip.tcpconnaborts',
|
|
name: 'ip.tcpconnaborts',
|
|
context: 'ip.tcpconnaborts',
|
|
title: 'TCP connection aborts',
|
|
units: 'aborts/s',
|
|
family: 'tcp',
|
|
chartType: 'line',
|
|
priority: 733,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'baddata', name: 'baddata', algorithm: 'incremental' },
|
|
{ id: 'userclosed', name: 'userclosed', algorithm: 'incremental' },
|
|
{ id: 'nomemory', name: 'nomemory', algorithm: 'incremental' },
|
|
{ id: 'timeout', name: 'timeout', algorithm: 'incremental' },
|
|
{ id: 'linger', name: 'linger', algorithm: 'incremental' },
|
|
{ id: 'failed', name: 'failed', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ip.tcpofo',
|
|
name: 'ip.tcpofo',
|
|
context: 'ip.tcpofo',
|
|
title: 'TCP out-of-order queue',
|
|
units: 'packets/s',
|
|
family: 'tcp',
|
|
chartType: 'line',
|
|
priority: 734,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'inqueue', name: 'inqueue', algorithm: 'incremental' },
|
|
{ id: 'dropped', name: 'dropped', algorithm: 'incremental' },
|
|
{ id: 'merged', name: 'merged', algorithm: 'incremental' },
|
|
{ id: 'pruned', name: 'pruned', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ip.tcpreorders',
|
|
name: 'ip.tcpreorders',
|
|
context: 'ip.tcpreorders',
|
|
title: 'TCP reorders',
|
|
units: 'packets/s',
|
|
family: 'tcp',
|
|
chartType: 'line',
|
|
priority: 735,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'timestamp', name: 'timestamp', algorithm: 'incremental' },
|
|
{ id: 'sack', name: 'sack', algorithm: 'incremental' },
|
|
{ id: 'fack', name: 'fack', algorithm: 'incremental' },
|
|
{ id: 'reno', name: 'reno', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ip.tcphandshake',
|
|
name: 'ip.tcphandshake',
|
|
context: 'ip.tcphandshake',
|
|
title: 'TCP handshake issues',
|
|
units: 'events/s',
|
|
family: 'tcp',
|
|
chartType: 'line',
|
|
priority: 736,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'EstabResets', name: 'EstabResets', algorithm: 'incremental' },
|
|
{ id: 'OutRsts', name: 'OutRsts', algorithm: 'incremental' },
|
|
{ id: 'AttemptFails', name: 'AttemptFails', algorithm: 'incremental' },
|
|
{ id: 'SynRetrans', name: 'SynRetrans', algorithm: 'incremental' },
|
|
],
|
|
},
|
|
{
|
|
id: 'ip.tcpmemorypressures',
|
|
name: 'ip.tcpmemorypressures',
|
|
context: 'ip.tcpmemorypressures',
|
|
title: 'TCP memory pressures',
|
|
units: 'events/s',
|
|
family: 'tcp',
|
|
chartType: 'line',
|
|
priority: 737,
|
|
plugin: 'proc',
|
|
dimensions: [{ id: 'pressures', name: 'pressures', algorithm: 'incremental' }],
|
|
},
|
|
]
|
|
|
|
export function makeDiskAwaitChart(disk) {
|
|
return {
|
|
id: `disk_await.${disk}`,
|
|
name: `disk_await.${disk}`,
|
|
context: 'disk.await',
|
|
title: `Disk ${disk} average wait time`,
|
|
units: 'milliseconds/operation',
|
|
family: disk,
|
|
chartType: 'line',
|
|
priority: 2030,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'reads', name: 'reads', algorithm: 'absolute' },
|
|
{ id: 'writes', name: 'writes', algorithm: 'absolute' },
|
|
],
|
|
}
|
|
}
|
|
|
|
export function makeDiskAvgszChart(disk) {
|
|
return {
|
|
id: `disk_avgsz.${disk}`,
|
|
name: `disk_avgsz.${disk}`,
|
|
context: 'disk.avgsz',
|
|
title: `Disk ${disk} average operation size`,
|
|
units: 'KiB/operation',
|
|
family: disk,
|
|
chartType: 'line',
|
|
priority: 2040,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'reads', name: 'reads', algorithm: 'absolute' },
|
|
{ id: 'writes', name: 'writes', algorithm: 'absolute' },
|
|
],
|
|
}
|
|
}
|
|
|
|
export function makeDiskQopsChart(disk) {
|
|
return {
|
|
id: `disk_qops.${disk}`,
|
|
name: `disk_qops.${disk}`,
|
|
context: 'disk.qops',
|
|
title: `Disk ${disk} queued operations`,
|
|
units: 'operations',
|
|
family: disk,
|
|
chartType: 'line',
|
|
priority: 2050,
|
|
plugin: 'proc',
|
|
dimensions: [{ id: 'operations', name: 'operations', algorithm: 'absolute' }],
|
|
}
|
|
}
|
|
|
|
export function makeDiskBusyChart(disk) {
|
|
return {
|
|
id: `disk_busy.${disk}`,
|
|
name: `disk_busy.${disk}`,
|
|
context: 'disk.busy',
|
|
title: `Disk ${disk} busy time`,
|
|
units: 'milliseconds',
|
|
family: disk,
|
|
chartType: 'area',
|
|
priority: 2060,
|
|
plugin: 'proc',
|
|
dimensions: [{ id: 'busy', name: 'busy', algorithm: 'incremental' }],
|
|
}
|
|
}
|
|
|
|
export function makeDiskIotimeChart(disk) {
|
|
return {
|
|
id: `disk_iotime.${disk}`,
|
|
name: `disk_iotime.${disk}`,
|
|
context: 'disk.iotime',
|
|
title: `Disk ${disk} I/O time`,
|
|
units: 'milliseconds/s',
|
|
family: disk,
|
|
chartType: 'line',
|
|
priority: 2070,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'reads', name: 'reads', algorithm: 'incremental' },
|
|
{ id: 'writes', name: 'writes', algorithm: 'incremental' },
|
|
],
|
|
}
|
|
}
|
|
|
|
export function makeDiskDiscardChart(disk) {
|
|
return {
|
|
id: `disk_discard.${disk}`,
|
|
name: `disk_discard.${disk}`,
|
|
context: 'disk.discard',
|
|
title: `Disk ${disk} discards`,
|
|
units: 'operations/s',
|
|
family: disk,
|
|
chartType: 'line',
|
|
priority: 2080,
|
|
plugin: 'proc',
|
|
dimensions: [
|
|
{ id: 'operations', name: 'operations', algorithm: 'incremental' },
|
|
{ id: 'sectors', name: 'sectors', algorithm: 'incremental' },
|
|
],
|
|
}
|
|
}
|
|
|
|
export function makeNetSpeedChart(iface) {
|
|
return {
|
|
id: `net_speed.${iface}`,
|
|
name: `net_speed.${iface}`,
|
|
context: 'net.speed',
|
|
title: `Interface ${iface} link speed`,
|
|
units: 'kilobits/s',
|
|
family: iface,
|
|
chartType: 'line',
|
|
priority: 3040,
|
|
plugin: 'proc',
|
|
dimensions: [{ id: 'speed', name: 'speed', algorithm: 'absolute' }],
|
|
}
|
|
}
|
|
|
|
export function makeCpuFreqChart() {
|
|
return {
|
|
id: 'cpu.cpufreq',
|
|
name: 'cpu.cpufreq',
|
|
context: 'cpu.cpufreq',
|
|
title: 'CPU frequency',
|
|
units: 'MHz',
|
|
family: 'cpufreq',
|
|
chartType: 'line',
|
|
priority: 180,
|
|
plugin: 'proc',
|
|
dimensions: [],
|
|
}
|
|
}
|
|
|
|
export function makeCgroupCpuChart(id, title) {
|
|
const safe = String(id).replace(/[^a-zA-Z0-9_.-]/g, '_').slice(0, 96)
|
|
const display = title || safe
|
|
return {
|
|
id: `cgroup.cpu.${safe}`,
|
|
name: `cgroup.cpu.${safe}`,
|
|
context: 'cgroup.cpu',
|
|
title: `${display} · CPU`,
|
|
units: 'percentage',
|
|
family: display,
|
|
chartType: 'area',
|
|
priority: 6000,
|
|
plugin: 'cgroups',
|
|
dimensions: [
|
|
{ id: 'user', name: 'user', algorithm: 'absolute' },
|
|
{ id: 'system', name: 'system', algorithm: 'absolute' },
|
|
],
|
|
}
|
|
}
|
|
|
|
export function makeCgroupMemChart(id, title) {
|
|
const safe = String(id).replace(/[^a-zA-Z0-9_.-]/g, '_').slice(0, 96)
|
|
const display = title || safe
|
|
return {
|
|
id: `cgroup.mem.${safe}`,
|
|
name: `cgroup.mem.${safe}`,
|
|
context: 'cgroup.mem',
|
|
title: `${display} · memory`,
|
|
units: 'MiB',
|
|
family: display,
|
|
chartType: 'area',
|
|
priority: 6100,
|
|
plugin: 'cgroups',
|
|
dimensions: [
|
|
{ id: 'usage', name: 'usage', algorithm: 'absolute' },
|
|
{ id: 'limit', name: 'limit', algorithm: 'absolute' },
|
|
],
|
|
}
|
|
}
|
|
|
|
export function makeCgroupIoChart(id, title) {
|
|
const safe = String(id).replace(/[^a-zA-Z0-9_.-]/g, '_').slice(0, 96)
|
|
const display = title || safe
|
|
return {
|
|
id: `cgroup.io.${safe}`,
|
|
name: `cgroup.io.${safe}`,
|
|
context: 'cgroup.io',
|
|
title: `${display} · I/O`,
|
|
units: 'KiB/s',
|
|
family: display,
|
|
chartType: 'area',
|
|
priority: 6200,
|
|
plugin: 'cgroups',
|
|
dimensions: [
|
|
{ id: 'read', name: 'read', algorithm: 'incremental' },
|
|
{ id: 'write', name: 'write', algorithm: 'incremental' },
|
|
],
|
|
}
|
|
}
|
|
|
|
export function makeSensorTempChart(chip, label) {
|
|
const id = `${chip}_${label}`.replace(/[^a-zA-Z0-9_.-]/g, '_').slice(0, 64)
|
|
return {
|
|
id: `sensors.temp.${id}`,
|
|
name: `sensors.temp.${id}`,
|
|
context: 'sensors.temperature',
|
|
title: `Temperature ${chip} ${label}`,
|
|
units: 'Celsius',
|
|
family: chip,
|
|
chartType: 'line',
|
|
priority: 7000,
|
|
plugin: 'sensors',
|
|
dimensions: [{ id: 'temperature', name: 'temperature', algorithm: 'absolute' }],
|
|
}
|
|
}
|
|
|
|
export function makeThermalZoneChart(zone, type) {
|
|
const id = String(zone).replace(/[^a-zA-Z0-9_.-]/g, '_')
|
|
return {
|
|
id: `sensors.thermal.${id}`,
|
|
name: `sensors.thermal.${id}`,
|
|
context: 'sensors.thermal',
|
|
title: `Thermal zone ${type || id}`,
|
|
units: 'Celsius',
|
|
family: type || id,
|
|
chartType: 'line',
|
|
priority: 7010,
|
|
plugin: 'sensors',
|
|
dimensions: [{ id: 'temperature', name: 'temperature', algorithm: 'absolute' }],
|
|
}
|
|
}
|