import { PerformanceEntry, PerformanceObserver, performance } from 'perf_hooks';
import Statistics, { StatisticsData } from '../types/Statistics';
import { PerformanceEntry, PerformanceObserver, performance } from 'perf_hooks';
import Statistics, { StatisticsData } from '../types/Statistics';
import Configuration from '../utils/Configuration';
import { MessageType } from '../types/ocpp/MessageType';
import { URL } from 'url';
import Utils from '../utils/Utils';
import Configuration from '../utils/Configuration';
import { MessageType } from '../types/ocpp/MessageType';
import { URL } from 'url';
import Utils from '../utils/Utils';
- const beginId = 'begin' + id.charAt(0).toUpperCase() + id.slice(1);
- performance.mark(beginId);
- return beginId;
+ const markId = `${id.charAt(0).toUpperCase() + id.slice(1)}~${Utils.generateUUID()}`;
+ performance.mark(markId);
+ return markId;
- public static endMeasure(name: string, beginId: string): void {
- performance.measure(name, beginId);
- performance.clearMarks(beginId);
+ public static endMeasure(name: string, markId: string): void {
+ performance.measure(name, markId);
+ performance.clearMarks(markId);
this.displayInterval = setInterval(() => {
this.logStatistics();
}, Configuration.getLogStatisticsInterval() * 1000);
this.displayInterval = setInterval(() => {
this.logStatistics();
}, Configuration.getLogStatisticsInterval() * 1000);
this.statistics.statisticsData[entryName].ninetyFiveThPercentileTimeMeasurement = this.percentile(this.statistics.statisticsData[entryName].timeMeasurementSeries, 95);
this.statistics.statisticsData[entryName].stdDevTimeMeasurement = this.stdDeviation(this.statistics.statisticsData[entryName].timeMeasurementSeries);
if (Configuration.getPerformanceStorage().enabled) {
this.statistics.statisticsData[entryName].ninetyFiveThPercentileTimeMeasurement = this.percentile(this.statistics.statisticsData[entryName].timeMeasurementSeries, 95);
this.statistics.statisticsData[entryName].stdDevTimeMeasurement = this.stdDeviation(this.statistics.statisticsData[entryName].timeMeasurementSeries);
if (Configuration.getPerformanceStorage().enabled) {