mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-25 02:00:32 +00:00
add type to duplicate metric
This commit is contained in:
@@ -258,7 +258,7 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics {
|
||||
Subsystem: MetricsSubsystem,
|
||||
Name: "duplicate_vote_receive",
|
||||
Help: "Number of votes received multiple times from the same peer by peer",
|
||||
}, append(labels, "peer_id")).With(labelsAndValues...),
|
||||
}, append(labels, "peer_id", "type")).With(labelsAndValues...),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ func (conR *Reactor) ReceiveEnvelope(e p2p.Envelope) {
|
||||
|
||||
duplicate := ps.SetReceivedVote(msg.Vote)
|
||||
if duplicate {
|
||||
conR.Metrics.DuplicateVoteReceive.With("peer_id", string(e.Src.ID())).Add(1)
|
||||
conR.Metrics.DuplicateVoteReceive.With("peer_id", string(e.Src.ID()), "type", msg.Vote.Type.String()).Add(1)
|
||||
}
|
||||
|
||||
cs.peerMsgQueue <- msgInfo{msg, e.Src.ID()}
|
||||
|
||||
@@ -19,6 +19,8 @@ type BitArray struct {
|
||||
Elems []uint64 `json:"elems"` // NOTE: persisted via reflect, must be exported
|
||||
}
|
||||
|
||||
// New bit array creates a bit array where all of the bits are initially 'false'
|
||||
//
|
||||
// NewBitArray returns a new bit array.
|
||||
// It returns nil if the number of bits is zero.
|
||||
func NewBitArray(bits int) *BitArray {
|
||||
@@ -39,6 +41,8 @@ func (bA *BitArray) Size() int {
|
||||
return bA.Bits
|
||||
}
|
||||
|
||||
// The bit array represents true as 1 and false as 0
|
||||
//
|
||||
// GetIndex returns the bit at index i within the bit array.
|
||||
// The behavior is undefined if i >= bA.Bits
|
||||
func (bA *BitArray) GetIndex(i int) bool {
|
||||
|
||||
Reference in New Issue
Block a user