mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-18 19:15:19 +00:00
wip
This commit is contained in:
parent
9a9b751626
commit
102c3c317e
@ -37,6 +37,12 @@ var (
|
||||
Name: "recv_bytes_total",
|
||||
Help: "Total amount of data received",
|
||||
}, []string{"device"})
|
||||
metricDeviceRecvDecompressedBytes = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "syncthing",
|
||||
Subsystem: "protocol",
|
||||
Name: "recv_decompressed_bytes_total",
|
||||
Help: "Total amount of data received, after decompression",
|
||||
}, []string{"device"})
|
||||
metricDeviceRecvMessages = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "syncthing",
|
||||
Subsystem: "protocol",
|
||||
|
@ -541,6 +541,8 @@ func (c *rawConnection) readMessageAfterHeader(hdr Header, fourByteBuf []byte) (
|
||||
|
||||
// ... and is then unmarshalled
|
||||
|
||||
metricDeviceRecvDecompressedBytes.WithLabelValues(c.idString).Add(float64(4 + len(buf)))
|
||||
|
||||
msg, err := newMessage(hdr.Type)
|
||||
if err != nil {
|
||||
BufferPool.Put(buf)
|
||||
@ -581,6 +583,8 @@ func (c *rawConnection) readHeader(fourByteBuf []byte) (Header, error) {
|
||||
return Header{}, fmt.Errorf("unmarshalling header: %w", err)
|
||||
}
|
||||
|
||||
metricDeviceRecvDecompressedBytes.WithLabelValues(c.idString).Add(float64(2 + len(buf)))
|
||||
|
||||
return hdr, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user