import { MongoClient } from 'mongodb'
-import { Storage } from './Storage.js'
import { BaseError } from '../../exception/index.js'
import { type Statistics, StorageType } from '../../types/index.js'
import { Constants } from '../../utils/index.js'
+import { Storage } from './Storage.js'
export class MongoDBStorage extends Storage {
private readonly client?: MongoClient
public async storePerformanceStatistics (performanceStatistics: Statistics): Promise<void> {
try {
+ this.setPerformanceStatistics(performanceStatistics)
this.checkDBConnection()
await this.client
?.db(this.dbName)
}
public async close (): Promise<void> {
+ this.clearPerformanceStatistics()
try {
if (this.connected && this.client != null) {
await this.client.close()