Constants,
JSONStringifyWithMapSupport,
buildPerformanceStatisticsMessage,
+ extractTimeSeriesValues,
formatDurationSeconds,
generateUUID,
logPrefix,
value: entry.duration,
}));
this.statistics.statisticsData.get(entryName).medTimeMeasurement = median(
- this.extractTimeSeriesValues(
- this.statistics.statisticsData.get(entryName).measurementTimeSeries
- )
+ extractTimeSeriesValues(this.statistics.statisticsData.get(entryName).measurementTimeSeries)
);
this.statistics.statisticsData.get(entryName).ninetyFiveThPercentileTimeMeasurement =
nthPercentile(
- this.extractTimeSeriesValues(
+ extractTimeSeriesValues(
this.statistics.statisticsData.get(entryName).measurementTimeSeries
),
95
);
this.statistics.statisticsData.get(entryName).stdDevTimeMeasurement = stdDeviation(
- this.extractTimeSeriesValues(
- this.statistics.statisticsData.get(entryName).measurementTimeSeries
- )
+ extractTimeSeriesValues(this.statistics.statisticsData.get(entryName).measurementTimeSeries)
);
if (Configuration.getPerformanceStorage().enabled) {
parentPort?.postMessage(buildPerformanceStatisticsMessage(this.statistics));
}
}
- private extractTimeSeriesValues(timeSeries: CircularArray<TimestampedData>): number[] {
- return timeSeries.map((timeSeriesItem) => timeSeriesItem.value);
- }
-
private logPrefix = (): string => {
return logPrefix(` ${this.objName} | Performance statistics`);
};
import clone from 'just-clone';
import { Constants } from './Constants';
-import { WebSocketCloseEventStatusString } from '../types';
+import { type TimestampedData, WebSocketCloseEventStatusString } from '../types';
export const logPrefix = (prefixString = ''): string => {
return `${new Date().toLocaleString()}${prefixString}`;
);
};
+export const extractTimeSeriesValues = (timeSeries: Array<TimestampedData>): number[] => {
+ return timeSeries.map((timeSeriesItem) => timeSeriesItem.value);
+};
+
export const isObject = (item: unknown): boolean => {
return (
isNullOrUndefined(item) === false && typeof item === 'object' && Array.isArray(item) === false