Commit | Line | Data |
---|---|---|
1fe0632a JB |
1 | import type { AutomaticTransactionGeneratorConfiguration } from '../types'; |
2 | ||
268a74bb | 3 | export class Constants { |
7d34a2f4 | 4 | static readonly DEFAULT_BOOT_NOTIFICATION_INTERVAL = 60000; // Ms |
c3da35d4 JB |
5 | static readonly DEFAULT_HEARTBEAT_INTERVAL = 60000; // Ms |
6 | static readonly DEFAULT_METER_VALUES_INTERVAL = 60000; // Ms | |
d2a64eb5 | 7 | |
10570d97 | 8 | static readonly CHARGING_STATION_DEFAULT_RESET_TIME = 60000; // Ms |
a4cc42ea | 9 | static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME = 1000; // Ms |
1fe0632a | 10 | |
1fe0632a JB |
11 | static readonly DEFAULT_ATG_CONFIGURATION: AutomaticTransactionGeneratorConfiguration = |
12 | Object.freeze({ | |
13 | enable: false, | |
86b46b49 JB |
14 | minDuration: 60, |
15 | maxDuration: 120, | |
16 | minDelayBetweenTwoTransactions: 15, | |
17 | maxDelayBetweenTwoTransactions: 30, | |
1fe0632a | 18 | probabilityOfStart: 1, |
86b46b49 | 19 | stopAfterHours: 0.25, |
1fe0632a JB |
20 | stopOnConnectionFailure: true, |
21 | }); | |
9ac86a7e | 22 | |
b25b8684 | 23 | // See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string |
3637ca2c JB |
24 | static readonly SEMVER_PATTERN = |
25 | '^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$'; | |
b25b8684 | 26 | |
9a15316c | 27 | static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY = 1024; |
1e080116 | 28 | |
3f94cab5 JB |
29 | static readonly DEFAULT_HASH_ALGORITHM = 'sha384'; |
30 | ||
c69294f7 | 31 | static readonly DEFAULT_IDTAG = '00000000'; |
3d2ff9e4 | 32 | |
291cb255 | 33 | static readonly DEFAULT_CONNECTION_TIMEOUT = 30; |
9ccca265 | 34 | |
25f5a959 JB |
35 | static readonly DEFAULT_LOG_STATISTICS_INTERVAL = 60; // Seconds |
36 | ||
9ccca265 | 37 | static readonly DEFAULT_FLUCTUATION_PERCENT = 5; |
2a370053 | 38 | |
a6b3c6c3 | 39 | static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME = 'performanceRecords.json'; |
7f774a55 | 40 | static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME = 'e-mobility-charging-stations-simulator'; |
ae8ee665 | 41 | static readonly PERFORMANCE_RECORDS_TABLE = 'performance_records'; |
6a49ad23 | 42 | |
adbddcb4 JB |
43 | static readonly DEFAULT_UI_SERVER_HOST = 'localhost'; |
44 | static readonly DEFAULT_UI_SERVER_PORT = 8080; | |
4db8406c | 45 | |
2a232a18 JB |
46 | static readonly UNKNOWN_COMMAND = 'unknown command'; |
47 | ||
59395dc1 JB |
48 | static readonly MAX_RANDOM_INTEGER = 281474976710654; |
49 | ||
59b6ed8d JB |
50 | static readonly EMPTY_FREEZED_OBJECT = Object.freeze({}); |
51 | static readonly EMPTY_FUNCTION = Object.freeze(() => { | |
52 | /* This is intentional */ | |
53 | }); | |
54 | ||
d193a949 JB |
55 | static readonly DEFAULT_RESERVATION_EXPIRATION_OBSERVATION_INTERVAL = 5000; // Ms |
56 | ||
4db8406c JB |
57 | private constructor() { |
58 | // This is intentional | |
59 | } | |
f7869514 | 60 | } |