This commit is contained in:
boufni95 2025-04-01 21:11:30 +00:00
parent fe11182eec
commit b3ac15ff63
3 changed files with 4 additions and 4 deletions

View file

@ -10,7 +10,7 @@ export default class {
lastPersistedCache: number = 0
constructor(settings: StorageSettings, tlvStorageFactory: TlvStorageFactory) {
const metricsPath = [settings.dataDir, "metric_events"].filter(s => !!s).join("/")
this.tlvStorage = tlvStorageFactory.NewStorage({ name: "metrics", path: metricsPath })
this.tlvStorage = tlvStorageFactory.NewStorage({ name: 'usage', path: metricsPath })
this.cachePath = [settings.dataDir, "metric_cache"].filter(s => !!s).join("/")
if (!fs.existsSync(this.cachePath)) {
fs.mkdirSync(this.cachePath, { recursive: true });

View file

@ -36,7 +36,7 @@ export class StateBundler {
interval: NodeJS.Timeout
constructor(dataDir: string, tlvStorageFactory: TlvStorageFactory) {
const bundlerPath = [dataDir, "bundler_events"].filter(s => !!s).join("/")
this.tlvStorage = tlvStorageFactory.NewStorage({ name: "bundler", path: bundlerPath })
this.tlvStorage = tlvStorageFactory.NewStorage({ name: 'bundler', path: bundlerPath })
this.interval = setInterval(() => {
const mem = process.memoryUsage()
this.AddValue('_root', 'memory_rss_kb', Math.ceil(mem.rss / 1000 || 0), true)

View file

@ -8,8 +8,8 @@ import { ProcessMetrics, ProcessMetricsCollector } from './processMetricsCollect
import { integerToUint8Array } from '../../helpers/tlv.js';
export type SerializableLatestData = Record<string, Record<string, { base64tlvs: string[], current_chunk: number, available_chunks: number[] }>>
export type SerializableTlvFile = { base64fileData: string, chunks: number[] }
const usageStorageName = 'usage'
const bundlerStorageName = 'bundler'
export const usageStorageName = 'usage'
export const bundlerStorageName = 'bundler'
export type TlvStorageSettings = {
path: string
name: typeof usageStorageName | typeof bundlerStorageName