diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-16 16:37:38 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:22 +0800 |
commit | 4ef4aae7f34155deb7884c7fdc67878dbaf907a7 (patch) | |
tree | 90adc6d548e2a44c1a43b2de4a5b28ee85f4361a /dex/metrics.go | |
parent | ac03172a8a9d8c217f405973bc096b06c5c5b4e0 (diff) | |
download | go-tangerine-4ef4aae7f34155deb7884c7fdc67878dbaf907a7.tar.gz go-tangerine-4ef4aae7f34155deb7884c7fdc67878dbaf907a7.tar.zst go-tangerine-4ef4aae7f34155deb7884c7fdc67878dbaf907a7.zip |
dex: add meter for agreement result (#260)
Diffstat (limited to 'dex/metrics.go')
-rw-r--r-- | dex/metrics.go | 26 |
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)) |