use declareCounter rather then gauge for certain metrics

This commit is contained in:
Giovanni Petrantoni 2020-06-07 16:41:23 +09:00
parent a6a2a81711
commit 82b4ed8f44
3 changed files with 6 additions and 6 deletions

View File

@ -24,8 +24,8 @@ logScope:
declareGauge(libp2p_pubsub_peers, "pubsub peer instances") declareGauge(libp2p_pubsub_peers, "pubsub peer instances")
declareGauge(libp2p_pubsub_topics, "pubsub subscribed topics") declareGauge(libp2p_pubsub_topics, "pubsub subscribed topics")
declareGauge(libp2p_pubsub_validation_success, "pubsub successfully validated messages") declareCounter(libp2p_pubsub_validation_success, "pubsub successfully validated messages")
declareGauge(libp2p_pubsub_validation_failure, "pubsub failed validated messages") declareCounter(libp2p_pubsub_validation_failure, "pubsub failed validated messages")
declareGauge(libp2p_pubsub_peers_per_topic, "pubsub peers per topic", labels = ["topic"]) declareGauge(libp2p_pubsub_peers_per_topic, "pubsub peers per topic", labels = ["topic"])
type type

View File

@ -42,8 +42,8 @@ type
RPCHandler* = proc(peer: PubSubPeer, msg: seq[RPCMsg]): Future[void] {.gcsafe.} RPCHandler* = proc(peer: PubSubPeer, msg: seq[RPCMsg]): Future[void] {.gcsafe.}
declareGauge(libp2p_pubsub_encoded_messages, "number of messages encoded") declareCounter(libp2p_pubsub_encoded_messages, "number of messages encoded")
declareGauge(libp2p_pubsub_decoded_messages, "number of messages decoded") declareCounter(libp2p_pubsub_decoded_messages, "number of messages decoded")
proc id*(p: PubSubPeer): string = p.peerInfo.id proc id*(p: PubSubPeer): string = p.peerInfo.id

View File

@ -22,8 +22,8 @@ logScope:
const PubSubPrefix = "libp2p-pubsub:" const PubSubPrefix = "libp2p-pubsub:"
declareGauge(libp2p_pubsub_sig_verify_success, "pubsub successfully validated messages") declareCounter(libp2p_pubsub_sig_verify_success, "pubsub successfully validated messages")
declareGauge(libp2p_pubsub_sig_verify_failure, "pubsub failed validated messages") declareCounter(libp2p_pubsub_sig_verify_failure, "pubsub failed validated messages")
proc msgIdProvider(m: Message): string = proc msgIdProvider(m: Message): string =
## default msg id provider ## default msg id provider