Commit 1ce50bb4 authored by inphi's avatar inphi

fix channel_output_bytes_total metric

parent fa8b8b2f
...@@ -67,8 +67,6 @@ type Metrics struct { ...@@ -67,8 +67,6 @@ type Metrics struct {
ChannelOutputBytesTotal prometheus.Counter ChannelOutputBytesTotal prometheus.Counter
BatcherTxEvs opmetrics.EventVec BatcherTxEvs opmetrics.EventVec
lastChannelOutputBytes int
} }
var _ Metricer = (*Metrics)(nil) var _ Metricer = (*Metrics)(nil)
...@@ -228,9 +226,7 @@ func (m *Metrics) RecordChannelClosed(id derive.ChannelID, numPendingBlocks int, ...@@ -228,9 +226,7 @@ func (m *Metrics) RecordChannelClosed(id derive.ChannelID, numPendingBlocks int,
m.ChannelInputBytes.WithLabelValues(StageClosed).Set(float64(inputBytes)) m.ChannelInputBytes.WithLabelValues(StageClosed).Set(float64(inputBytes))
m.ChannelOutputBytes.Set(float64(outputComprBytes)) m.ChannelOutputBytes.Set(float64(outputComprBytes))
outputBytesDelta := outputComprBytes - m.lastChannelOutputBytes m.ChannelOutputBytesTotal.Add(float64(outputComprBytes))
m.lastChannelOutputBytes = outputComprBytes
m.ChannelOutputBytesTotal.Add(float64(outputBytesDelta))
var comprRatio float64 var comprRatio float64
if inputBytes > 0 { if inputBytes > 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment