X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2FStatistics.ts;h=ab2e826ae147039d96ae37b1ad5813ec589ddb89;hb=9d5b181b6165ba6b47b7ea9fb026747a9bb54b29;hp=0ee58f750e2809c7d8e1d81cc119b0f237cb67ed;hpb=c27c3eeea356b0692bef2327bb59aa99f9cbad8d;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/Statistics.ts b/src/types/Statistics.ts index 0ee58f75..ab2e826a 100644 --- a/src/types/Statistics.ts +++ b/src/types/Statistics.ts @@ -1,11 +1,18 @@ -import { CircularArray } from '../utils/CircularArray'; +import type { IncomingRequestCommand, RequestCommand } from './ocpp/Requests'; +import type { CircularArray } from '../utils'; +import type { WorkerData } from '../worker'; -export interface StatisticsData { +export type TimestampedData = { + timestamp: number; + value: number; +}; + +type StatisticsData = Partial<{ countRequest: number; countResponse: number; countError: number; countTimeMeasurement: number; - timeMeasurementSeries: CircularArray; + measurementTimeSeries: CircularArray; currentTimeMeasurement: number; minTimeMeasurement: number; maxTimeMeasurement: number; @@ -14,12 +21,13 @@ export interface StatisticsData { medTimeMeasurement: number; ninetyFiveThPercentileTimeMeasurement: number; stdDevTimeMeasurement: number; -} +}>; -export default interface Statistics { +export type Statistics = { id: string; - URI: string; + name: string; + uri: string; createdAt: Date; - lastUpdatedAt?: Date; - statisticsData: Record; -} + updatedAt?: Date; + statisticsData: Map; +} & WorkerData;