Updates
This commit is contained in:
@@ -5,10 +5,14 @@ import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
const MUTATING = new Set([
|
||||
'postMessage',
|
||||
'clearMessages',
|
||||
'mintInvite',
|
||||
'revokePeer',
|
||||
'setAlertConfig',
|
||||
'ackAlert',
|
||||
'silenceAlert',
|
||||
'runJob',
|
||||
'cancelJob',
|
||||
'exportSnapshot',
|
||||
'handshake',
|
||||
])
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Export formatters (JSON / Prometheus / shell) for /api/v*/allmetrics.
|
||||
* Export formatters (JSON / Prometheus / shell) for /api/v1|v2|v3/allmetrics.
|
||||
*/
|
||||
import os from 'os'
|
||||
import { getStore } from '../services/store.js'
|
||||
|
||||
@@ -122,7 +122,9 @@ export class MetricsCollector extends EventEmitter {
|
||||
*/
|
||||
constructor(opts = {}) {
|
||||
super()
|
||||
this.intervalMs = opts.intervalMs ?? Number(process.env.PEARDATA_SAMPLE_MS) || SAMPLE_INTERVAL_MS
|
||||
this.intervalMs =
|
||||
opts.intervalMs ??
|
||||
(Number(process.env.PEARDATA_SAMPLE_MS) || SAMPLE_INTERVAL_MS)
|
||||
this.timer = null
|
||||
this.running = false
|
||||
this.sampleCount = 0
|
||||
@@ -257,7 +259,7 @@ export class MetricsCollector extends EventEmitter {
|
||||
values: {
|
||||
running: load.running,
|
||||
blocked: 0,
|
||||
total: load.total || Object.keys(process || {}).length,
|
||||
total: load.total || 0,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user