Skip to content

Commit

Permalink
Fix calculation and doc comment in prometheus observer (#1456)
Browse files Browse the repository at this point in the history
* Fixed histogram calculation
* Fixed doc comment in test utility class

Signed-off-by: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com>

Signed-off-by: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com>
  • Loading branch information
CaptainIRS committed Oct 10, 2022
1 parent 85cf073 commit 1eade51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Utils {

/**
*
* @return {boolean} the fake path
* @return {boolean} if the process is a forked process
*/
static isForkedProcess() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Utils {

/**
*
* @return {boolean} the fake path
* @return {boolean} if the process is a forked process
*/
static isForkedProcess() {
return false;
Expand Down

0 comments on commit 1eade51

Please sign in to comment.