Further CPU Experimental Changes
This commit is contained in:
@@ -6,6 +6,7 @@ import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { CollectorPlugin } from './plugin.js'
|
||||
import { registerChart } from '../../../shared/metrics.js'
|
||||
import { readFileBuf } from '../../utils/fd-cache.js'
|
||||
|
||||
export function isBcacheEnabled() {
|
||||
const v = process.env.PEARDATA_BCACHE
|
||||
@@ -15,11 +16,8 @@ export function isBcacheEnabled() {
|
||||
}
|
||||
|
||||
function readNum(p) {
|
||||
try {
|
||||
return Number(fs.readFileSync(p, 'utf8').trim()) || 0
|
||||
} catch {
|
||||
return 0
|
||||
}
|
||||
const raw = readFileBuf(p)
|
||||
return raw ? Number(raw.trim()) || 0 : 0
|
||||
}
|
||||
|
||||
export class BcacheCollector extends CollectorPlugin {
|
||||
|
||||
Reference in New Issue
Block a user