From: Jérôme Benoit Date: Sat, 1 Jul 2023 12:10:29 +0000 (+0200) Subject: refactor: use a directory to store performance related files X-Git-Tag: v1.2.17~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=53b8a4fd3c9b2612ddecf5d7abd0715bbab94c64;p=e-mobility-charging-stations-simulator.git refactor: use a directory to store performance related files Signed-off-by: Jérôme Benoit --- diff --git a/.gitignore b/.gitignore index 5bf56abf..197aeb76 100644 --- a/.gitignore +++ b/.gitignore @@ -117,6 +117,7 @@ package-lock.json .eslintcache temp/ *.tar.gz +performance/ performanceRecords.json performanceRecords.json.lock *.db diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index b54f3900..3e3adbc2 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -476,11 +476,11 @@ export class Configuration { switch (storageType) { case StorageType.JSON_FILE: return Configuration.buildPerformanceUriFilePath( - Constants.DEFAULT_PERFORMANCE_RECORDS_FILENAME + `${Constants.DEFAULT_PERFORMANCE_DIRECTORY}/${Constants.DEFAULT_PERFORMANCE_RECORDS_FILENAME}` ); case StorageType.SQLITE: return Configuration.buildPerformanceUriFilePath( - `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db` + `${Constants.DEFAULT_PERFORMANCE_DIRECTORY}/${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db` ); default: throw new Error(`Performance storage URI is mandatory with storage type '${storageType}'`); diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index 30327b6a..c4ce0ff8 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -36,6 +36,7 @@ export class Constants { static readonly DEFAULT_FLUCTUATION_PERCENT = 5; + static readonly DEFAULT_PERFORMANCE_DIRECTORY = 'performance'; static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME = 'performanceRecords.json'; static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME = 'e-mobility-charging-stations-simulator'; static readonly PERFORMANCE_RECORDS_TABLE = 'performance_records';