fix
This commit is contained in:
parent
fe11182eec
commit
b3ac15ff63
3 changed files with 4 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ export default class {
|
||||||
lastPersistedCache: number = 0
|
lastPersistedCache: number = 0
|
||||||
constructor(settings: StorageSettings, tlvStorageFactory: TlvStorageFactory) {
|
constructor(settings: StorageSettings, tlvStorageFactory: TlvStorageFactory) {
|
||||||
const metricsPath = [settings.dataDir, "metric_events"].filter(s => !!s).join("/")
|
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("/")
|
this.cachePath = [settings.dataDir, "metric_cache"].filter(s => !!s).join("/")
|
||||||
if (!fs.existsSync(this.cachePath)) {
|
if (!fs.existsSync(this.cachePath)) {
|
||||||
fs.mkdirSync(this.cachePath, { recursive: true });
|
fs.mkdirSync(this.cachePath, { recursive: true });
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export class StateBundler {
|
||||||
interval: NodeJS.Timeout
|
interval: NodeJS.Timeout
|
||||||
constructor(dataDir: string, tlvStorageFactory: TlvStorageFactory) {
|
constructor(dataDir: string, tlvStorageFactory: TlvStorageFactory) {
|
||||||
const bundlerPath = [dataDir, "bundler_events"].filter(s => !!s).join("/")
|
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(() => {
|
this.interval = setInterval(() => {
|
||||||
const mem = process.memoryUsage()
|
const mem = process.memoryUsage()
|
||||||
this.AddValue('_root', 'memory_rss_kb', Math.ceil(mem.rss / 1000 || 0), true)
|
this.AddValue('_root', 'memory_rss_kb', Math.ceil(mem.rss / 1000 || 0), true)
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import { ProcessMetrics, ProcessMetricsCollector } from './processMetricsCollect
|
||||||
import { integerToUint8Array } from '../../helpers/tlv.js';
|
import { integerToUint8Array } from '../../helpers/tlv.js';
|
||||||
export type SerializableLatestData = Record<string, Record<string, { base64tlvs: string[], current_chunk: number, available_chunks: number[] }>>
|
export type SerializableLatestData = Record<string, Record<string, { base64tlvs: string[], current_chunk: number, available_chunks: number[] }>>
|
||||||
export type SerializableTlvFile = { base64fileData: string, chunks: number[] }
|
export type SerializableTlvFile = { base64fileData: string, chunks: number[] }
|
||||||
const usageStorageName = 'usage'
|
export const usageStorageName = 'usage'
|
||||||
const bundlerStorageName = 'bundler'
|
export const bundlerStorageName = 'bundler'
|
||||||
export type TlvStorageSettings = {
|
export type TlvStorageSettings = {
|
||||||
path: string
|
path: string
|
||||||
name: typeof usageStorageName | typeof bundlerStorageName
|
name: typeof usageStorageName | typeof bundlerStorageName
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue