diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-16 16:37:38 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:58 +0800 |
commit | 6cf8f9af687623e2811e2805d62d6147592d5ced (patch) | |
tree | a2c39192898f0c7e1fbc22b3ca933f5d14a5f6b3 | |
parent | 4e42c086e40938d107b18a2bf3555d0067dfba4a (diff) | |
download | go-tangerine-6cf8f9af687623e2811e2805d62d6147592d5ced.tar.gz go-tangerine-6cf8f9af687623e2811e2805d62d6147592d5ced.tar.zst go-tangerine-6cf8f9af687623e2811e2805d62d6147592d5ced.zip |
dex: add meter for agreement result (#260)
-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)) |