} from '../../utils/index.js'
export class JsonFileStorage extends Storage {
- private static performanceRecords: Map<string, Statistics>
-
private fd?: number
constructor (storageUri: string, logPrefix: string) {
}
public storePerformanceStatistics (performanceStatistics: Statistics): void {
+ this.setPerformanceStatistics(performanceStatistics)
this.checkPerformanceRecordsFile()
- JsonFileStorage.performanceRecords.set(performanceStatistics.id, performanceStatistics)
AsyncLock.runExclusive(AsyncLockType.performance, () => {
writeSync(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.fd!,
- JSONStringifyWithMapSupport([...JsonFileStorage.performanceRecords.values()], 2),
+ JSONStringifyWithMapSupport([...this.getPerformanceStatistics()], 2),
0,
'utf8'
)
}
public open (): void {
- JsonFileStorage.performanceRecords = new Map<string, Statistics>()
try {
if (this.fd == null) {
if (!existsSync(dirname(this.dbName))) {
}
public close (): void {
- JsonFileStorage.performanceRecords.clear()
+ this.clearPerformanceStatistics()
try {
if (this.fd != null) {
closeSync(this.fd)