diff --git a/packages/caliper-core/lib/worker/tx-observers/prometheus-push-tx-observer.js b/packages/caliper-core/lib/worker/tx-observers/prometheus-push-tx-observer.js index 3cbb4d7da..972c565f9 100644 --- a/packages/caliper-core/lib/worker/tx-observers/prometheus-push-tx-observer.js +++ b/packages/caliper-core/lib/worker/tx-observers/prometheus-push-tx-observer.js @@ -167,12 +167,12 @@ class PrometheusPushTxObserver extends TxObserverInterface { for (const result of results) { // pass/fail status from result.GetStatus() this.counterTxFinished.labels(result.GetStatus()).inc(); - this.histogramLatency.labels(result.GetStatus()).observe(result.GetTimeFinal() - result.GetTimeCreate()); + this.histogramLatency.labels(result.GetStatus()).observe((result.GetTimeFinal() - result.GetTimeCreate()) / 1000); } } else { // pass/fail status from result.GetStatus() this.counterTxFinished.labels(results.GetStatus()).inc(); - this.histogramLatency.labels(results.GetStatus()).observe((results.GetTimeFinal() - results.GetTimeCreate())/1000); + this.histogramLatency.labels(results.GetStatus()).observe((results.GetTimeFinal() - results.GetTimeCreate()) / 1000); } } diff --git a/packages/caliper-core/lib/worker/tx-observers/prometheus-tx-observer.js b/packages/caliper-core/lib/worker/tx-observers/prometheus-tx-observer.js index 6125fbf1e..eb9571f85 100644 --- a/packages/caliper-core/lib/worker/tx-observers/prometheus-tx-observer.js +++ b/packages/caliper-core/lib/worker/tx-observers/prometheus-tx-observer.js @@ -165,12 +165,12 @@ class PrometheusTxObserver extends TxObserverInterface { for (const result of results) { // pass/fail status from result.GetStatus() this.counterTxFinished.labels(result.GetStatus()).inc(); - this.histogramLatency.labels(result.GetStatus()).observe(result.GetTimeFinal() - result.GetTimeCreate()); + this.histogramLatency.labels(result.GetStatus()).observe((result.GetTimeFinal() - result.GetTimeCreate()) / 1000); } } else { // pass/fail status from result.GetStatus() this.counterTxFinished.labels(results.GetStatus()).inc(); - this.histogramLatency.labels(results.GetStatus()).observe((results.GetTimeFinal() - results.GetTimeCreate())/1000); + this.histogramLatency.labels(results.GetStatus()).observe((results.GetTimeFinal() - results.GetTimeCreate()) / 1000); } } } diff --git a/packages/caliper-core/test/worker/tx-observers/prometheus-push-tx-observer.js b/packages/caliper-core/test/worker/tx-observers/prometheus-push-tx-observer.js index ad6767a45..2368cf296 100644 --- a/packages/caliper-core/test/worker/tx-observers/prometheus-push-tx-observer.js +++ b/packages/caliper-core/test/worker/tx-observers/prometheus-push-tx-observer.js @@ -36,7 +36,7 @@ class Utils { /** * - * @return {boolean} the fake path + * @return {boolean} if the process is a forked process */ static isForkedProcess() { return false; diff --git a/packages/caliper-core/test/worker/tx-observers/prometheus-tx-observer.js b/packages/caliper-core/test/worker/tx-observers/prometheus-tx-observer.js index e5585e8a3..08b1ac67d 100644 --- a/packages/caliper-core/test/worker/tx-observers/prometheus-tx-observer.js +++ b/packages/caliper-core/test/worker/tx-observers/prometheus-tx-observer.js @@ -36,7 +36,7 @@ class Utils { /** * - * @return {boolean} the fake path + * @return {boolean} if the process is a forked process */ static isForkedProcess() { return false;