cds-caching 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -235,7 +235,7 @@ class StatisticsPersistenceManager {
|
|
|
235
235
|
// Calculate read-through performance metrics
|
|
236
236
|
if (totalRequests > 0) {
|
|
237
237
|
updatedStats.hitRatio = (updatedStats.hits / totalRequests) * 100;
|
|
238
|
-
updatedStats.throughput = totalRequests / (stats.uptimeMs / 1000);
|
|
238
|
+
updatedStats.throughput = stats.uptimeMs > 0 ? totalRequests / (stats.uptimeMs / 1000) : 0;
|
|
239
239
|
updatedStats.errorRate = (updatedStats.errors / totalRequests) * 100;
|
|
240
240
|
}
|
|
241
241
|
|
|
@@ -247,7 +247,7 @@ class StatisticsPersistenceManager {
|
|
|
247
247
|
// Calculate native function performance metrics
|
|
248
248
|
const totalNativeOps = updatedStats.totalNativeOperations;
|
|
249
249
|
if (totalNativeOps > 0) {
|
|
250
|
-
updatedStats.nativeThroughput = totalNativeOps / (stats.uptimeMs / 1000);
|
|
250
|
+
updatedStats.nativeThroughput = stats.uptimeMs > 0 ? totalNativeOps / (stats.uptimeMs / 1000) : 0;
|
|
251
251
|
updatedStats.nativeErrorRate = (updatedStats.nativeErrors / totalNativeOps) * 100;
|
|
252
252
|
}
|
|
253
253
|
|
|
@@ -380,9 +380,9 @@ class StatisticsPersistenceManager {
|
|
|
380
380
|
: 0,
|
|
381
381
|
|
|
382
382
|
// Update percentiles (use max/min of existing and current, with min using mergeMin)
|
|
383
|
-
minHitLatency: mergeMin(Number(existingKey.minHitLatency) || 0, keyStats.minHitLatency),
|
|
383
|
+
minHitLatency: mergeMin(Number(existingKey.minHitLatency) || 0, keyStats.minHitLatency === Infinity ? 0 : keyStats.minHitLatency),
|
|
384
384
|
maxHitLatency: Math.max(Number(existingKey.maxHitLatency) || 0, keyStats.maxHitLatency || 0),
|
|
385
|
-
minMissLatency: mergeMin(Number(existingKey.minMissLatency) || 0, keyStats.minMissLatency),
|
|
385
|
+
minMissLatency: mergeMin(Number(existingKey.minMissLatency) || 0, keyStats.minMissLatency === Infinity ? 0 : keyStats.minMissLatency),
|
|
386
386
|
maxMissLatency: Math.max(Number(existingKey.maxMissLatency) || 0, keyStats.maxMissLatency || 0)
|
|
387
387
|
};
|
|
388
388
|
|