} from './ocpp/2.0/Responses.js'
export { OCPP20OptionalVariableName } from './ocpp/2.0/Variables.js'
export { OCPPVersion } from './ocpp/OCPPVersion.js'
-export { PerformanceData } from './orm/entities/PerformanceData.js'
export { PerformanceRecord } from './orm/entities/PerformanceRecord.js'
export type { Statistics, TimestampedData } from './Statistics.js'
export {
+++ /dev/null
-import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'
-
-import { PerformanceRecord } from './PerformanceRecord.js'
-
-@Entity()
-export class PerformanceData {
- @PrimaryKey()
- commandName!: string
-
- @Property()
- requestCount!: number
-
- @Property()
- responseCount!: number
-
- @Property()
- errorCount!: number
-
- @Property()
- timeMeasurementCount!: number
-
- @Property()
- measurementTimeSeries!: number[]
-
- @Property()
- currentTimeMeasurement!: number
-
- @Property()
- minTimeMeasurement!: number
-
- @Property()
- maxTimeMeasurement!: number
-
- @Property()
- totalTimeMeasurement!: number
-
- @Property()
- avgTimeMeasurement!: number
-
- @Property()
- medTimeMeasurement!: number
-
- @Property()
- ninetyFiveThPercentileTimeMeasurement!: number
-
- @Property()
- stdDevTimeMeasurement!: number
-
- @ManyToOne(() => PerformanceRecord)
- performanceRecord!: PerformanceRecord
-}
-import { Collection, Entity, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'
+import { Entity, PrimaryKey, Property } from '@mikro-orm/core'
-import { PerformanceData } from './PerformanceData.js'
+interface PerformanceData {
+ name: string
+ requestCount: number
+ responseCount: number
+ errorCount: number
+ timeMeasurementCount: number
+ measurementTimeSeries: Array<{
+ timestamp: number
+ value: number
+ }>
+ currentTimeMeasurement: number
+ minTimeMeasurement: number
+ maxTimeMeasurement: number
+ totalTimeMeasurement: number
+ avgTimeMeasurement: number
+ medTimeMeasurement: number
+ ninetyFiveThPercentileTimeMeasurement: number
+ stdDevTimeMeasurement: number
+}
@Entity()
export class PerformanceRecord {
@Property()
updatedAt?: Date
- @OneToMany(() => PerformanceData, performanceData => performanceData.performanceRecord)
- performanceData? = new Collection<PerformanceData>(this)
+ @Property()
+ performanceData!: PerformanceData[]
}