-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish different workers in Prometheus PushGateway #1427
Distinguish different workers in Prometheus PushGateway #1427
Conversation
Signed-off-by: CaptainIRS <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With every code change in caliper we need to add unit tests, and so we need a new unit test for this change as I don't think there is a unit test that covers this code
packages/caliper-core/lib/worker/tx-observers/prometheus-push-tx-observer.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have looked at https://github.com/hyperledger/caliper/blob/main/packages/caliper-core/test/worker/tx-observers/prometheus-push-tx-observer.js, but there doesn't seem to be any tests covering _sendUpdate
as it is being stubbed out in unit tests. I'm not sure how a unit test for this would look like as pushAdd is a method from the prom-client
library. Should the unit test just ensure that workerIndex
is being passed to the pushAdd
method (by using mocks)?
We would need a stub of the method |
* Remove redundant labels * Add roundIndex to groupings * Update unit tests utilizing workerIndex and roundIndex * Write new unit test for _sendUpdate Signed-off-by: CaptainIRS <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…caliper#1427) * Distinguish different workers in Prometheus PushGateway Signed-off-by: CaptainIRS <[email protected]> * Address review comments * Remove redundant labels * Add roundIndex to groupings * Update unit tests utilizing workerIndex and roundIndex * Write new unit test for _sendUpdate Signed-off-by: CaptainIRS <[email protected]> Signed-off-by: eravatee <[email protected]>
…caliper#1427) * Distinguish different workers in Prometheus PushGateway Signed-off-by: CaptainIRS <[email protected]> * Address review comments * Remove redundant labels * Add roundIndex to groupings * Update unit tests utilizing workerIndex and roundIndex * Write new unit test for _sendUpdate Signed-off-by: CaptainIRS <[email protected]> Signed-off-by: eravatee <[email protected]>
…caliper#1427) * Distinguish different workers in Prometheus PushGateway Signed-off-by: CaptainIRS <[email protected]> * Address review comments * Remove redundant labels * Add roundIndex to groupings * Update unit tests utilizing workerIndex and roundIndex * Write new unit test for _sendUpdate Signed-off-by: CaptainIRS <[email protected]> Signed-off-by: eravatee <[email protected]>
…caliper#1427) * Distinguish different workers in Prometheus PushGateway Signed-off-by: CaptainIRS <[email protected]> * Address review comments * Remove redundant labels * Add roundIndex to groupings * Update unit tests utilizing workerIndex and roundIndex * Write new unit test for _sendUpdate Signed-off-by: CaptainIRS <[email protected]> Signed-off-by: eravatee <[email protected]>
In this PR:
Fixes #1354
Results:
/metrics endpoint of PushGateway
Grafana dashboard showing metrics from two workers simultaneously