aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-16 16:37:38 +0800
committerGitHub <noreply@github.com>2019-03-16 16:37:38 +0800
commit91518d9592931b0c848ffac1874b9895c93cce3a (patch)
treed65d07e9ebf5878378a86d129e6dc3b5a31ccbed
parent34b004fcc1bbbce7d4edcd2fb681a5e803a7f525 (diff)
downloaddexon-91518d9592931b0c848ffac1874b9895c93cce3a.tar.gz
dexon-91518d9592931b0c848ffac1874b9895c93cce3a.tar.zst
dexon-91518d9592931b0c848ffac1874b9895c93cce3a.zip
dex: add meter for agreement result (#260)
-rw-r--r--dex/metrics.go26
1 files changed, 14 insertions, 12 deletions
diff --git a/dex/metrics.go b/dex/metrics.go
index 2b23af669..4ca16ece5 100644
--- a/dex/metrics.go
+++ b/dex/metrics.go
@@ -42,6 +42,10 @@ var (
propVoteInTrafficMeter = metrics.NewRegisteredMeter("dex/prop/votes/in/traffic", nil)
propVoteOutPacketsMeter = metrics.NewRegisteredMeter("dex/prop/votes/out/packets", nil)
propVoteOutTrafficMeter = metrics.NewRegisteredMeter("dex/prop/votes/out/traffic", nil)
+ propAgreementInPacketsMeter = metrics.NewRegisteredMeter("dex/prop/agreement/in/packets", nil)
+ propAgreementInTrafficMeter = metrics.NewRegisteredMeter("dex/prop/agreement/in/traffic", nil)
+ propAgreementOutPacketsMeter = metrics.NewRegisteredMeter("dex/prop/agreement/out/packets", nil)
+ propAgreementOutTrafficMeter = metrics.NewRegisteredMeter("dex/prop/agreement/out/traffic", nil)
propDKGPartialSignatureInPacketsMeter = metrics.NewRegisteredMeter("dex/prop/dkgpartialsignatures/in/packets", nil)
propDKGPartialSignatureInTrafficMeter = metrics.NewRegisteredMeter("dex/prop/dkgpartialsignatures/in/traffic", nil)
propDKGPartialSignatureOutPacketsMeter = metrics.NewRegisteredMeter("dex/prop/dkgpartialsignatures/out/packets", nil)
@@ -125,20 +129,19 @@ func (rw *meteredMsgReadWriter) ReadMsg() (p2p.Msg, error) {
packets, traffic = propTxnInPacketsMeter, propTxnInTrafficMeter
case msg.Code == CoreBlockMsg:
- packets = propCoreBlockInPacketsMeter
- traffic = propCoreBlockInTrafficMeter
+ packets, traffic = propCoreBlockInPacketsMeter, propCoreBlockInTrafficMeter
case msg.Code == VoteMsg:
packets, traffic = propVoteInPacketsMeter, propVoteInTrafficMeter
case msg.Code == PullBlocksMsg:
- packets = reqCoreBlockInPacketsMeter
- traffic = reqCoreBlockInTrafficMeter
+ packets, traffic = reqCoreBlockInPacketsMeter, reqCoreBlockInTrafficMeter
case msg.Code == PullVotesMsg:
packets, traffic = reqVoteInPacketsMeter, reqVoteInTrafficMeter
+ case msg.Code == AgreementMsg:
+ packets, traffic = propAgreementInPacketsMeter, propAgreementInTrafficMeter
case msg.Code == DKGPartialSignatureMsg:
- packets = propDKGPartialSignatureInPacketsMeter
- traffic = propDKGPartialSignatureInTrafficMeter
+ packets, traffic = propDKGPartialSignatureInPacketsMeter, propDKGPartialSignatureInTrafficMeter
}
packets.Mark(1)
traffic.Mark(int64(msg.Size))
@@ -168,20 +171,19 @@ func (rw *meteredMsgReadWriter) WriteMsg(msg p2p.Msg) error {
packets, traffic = propTxnOutPacketsMeter, propTxnOutTrafficMeter
case msg.Code == CoreBlockMsg:
- packets = propCoreBlockOutPacketsMeter
- traffic = propCoreBlockOutTrafficMeter
+ packets, traffic = propCoreBlockOutPacketsMeter, propCoreBlockOutTrafficMeter
case msg.Code == VoteMsg:
packets, traffic = propVoteOutPacketsMeter, propVoteOutTrafficMeter
case msg.Code == PullBlocksMsg:
- packets = reqCoreBlockOutPacketsMeter
- traffic = reqCoreBlockOutTrafficMeter
+ packets, traffic = reqCoreBlockOutPacketsMeter, reqCoreBlockOutTrafficMeter
case msg.Code == PullVotesMsg:
packets, traffic = reqVoteOutPacketsMeter, reqVoteOutTrafficMeter
+ case msg.Code == AgreementMsg:
+ packets, traffic = propAgreementOutPacketsMeter, propAgreementOutTrafficMeter
case msg.Code == DKGPartialSignatureMsg:
- packets = propDKGPartialSignatureOutPacketsMeter
- traffic = propDKGPartialSignatureOutTrafficMeter
+ packets, traffic = propDKGPartialSignatureOutPacketsMeter, propDKGPartialSignatureOutTrafficMeter
}
packets.Mark(1)
traffic.Mark(int64(msg.Size))