fixes for gauge reset
MODIFY
src/monitoring/DatabaseMonitoringMetric.ts
src/monitoring/DatabaseMonitoringMetric.ts
@@ -49,6 +49,9 @@ class DatabaseMonitoringMetric {
this.metricSum = 0;
this.metricAvg = 0;
this.metricCount = 0;
+ this.gaugeMetricCount.reset();
+ this.gaugeMetricSum.reset();
+ this.gaugeMetricAvg.reset();
}
}
export { DatabaseMonitoringMetric };

MODIFY
src/utils/Logging.ts
src/utils/Logging.ts
@@ -106,9 +106,9 @@ export default class Logging {
const durationMetric = global.monitoringServer.getDatabaseMetric('Duration', hashCode, 'db duration', Object.keys(labels));
durationMetric.setValue(labels, executionDurationMillis);
const requestSizeMetric = global.monitoringServer.getDatabaseMetric('RequestSize', hashCode, 'db duration', Object.keys(labels));
- requestSizeMetric.setValue(labels, executionDurationMillis);
+ requestSizeMetric.setValue(labels, sizeOfRequestDataKB);
const responseSizeMetric = global.monitoringServer.getDatabaseMetric('ResponseSize', hashCode, 'db duration', Object.keys(labels));
- responseSizeMetric.setValue(labels, executionDurationMillis);
+ responseSizeMetric.setValue(labels, sizeOfResponseDataKB);
await PerformanceStorage.savePerformanceRecord(
Utils.buildPerformanceRecord({
tenantSubdomain: tenant.subdomain,

fixes for gauge reset