feat: add performance statistics to UI protocol
[e-mobility-charging-stations-simulator.git] / src / performance / storage / MongoDBStorage.ts
index 48ce06d679d5131777542444bc46d87b3e40178b..b3d535e2906d33d6b13b1184e8b8458256f294a3 100644 (file)
@@ -20,6 +20,7 @@ export class MongoDBStorage extends Storage {
 
   public async storePerformanceStatistics (performanceStatistics: Statistics): Promise<void> {
     try {
+      this.setPerformanceStatistics(performanceStatistics)
       this.checkDBConnection()
       await this.client
         ?.db(this.dbName)
@@ -42,6 +43,7 @@ export class MongoDBStorage extends Storage {
   }
 
   public async close (): Promise<void> {
+    this.clearPerformanceStatistics()
     try {
       if (this.connected && this.client != null) {
         await this.client.close()