PersistMeasureInstance

Implements IPersistMeasureInstance

Default file-based implementation of IPersistMeasureInstance.

Features:

  • Wraps PersistBase for atomic JSON writes
  • Soft delete via removed: true flag
  • listMeasureData filters out removed entries
constructor(bucket: string);
bucket: string
_storage: any

Underlying file-based storage for this bucket

waitForInit(initial: boolean): Promise<void>;

Initializes the underlying PersistBase storage.

readMeasureData(key: string): Promise<MeasureData | null>;

Reads a measure entry by key. Returns null if entry is missing or soft-deleted.

writeMeasureData(data: MeasureData, key: string): Promise<void>;

Writes a measure entry under the given key.

removeMeasureData(key: string): Promise<void>;

Soft-deletes an entry by writing removed: true flag while preserving the file.

listMeasureData(): AsyncGenerator<string>;

Iterates all entries in the bucket, yielding keys of non-removed entries only.