Update On Mon Aug 26 20:34:39 CEST 2024

This commit is contained in:
github-action[bot]
2024-08-26 20:34:40 +02:00
parent 2e77f8eb45
commit 4afce62e47
112 changed files with 1924 additions and 896 deletions

View File

@@ -249,7 +249,7 @@ func (b *readerImpl) parseNetworkInfo(metricMap map[string]*dto.MetricFamily, nm
}
if b.lastMetrics != nil {
passedTime := now.Sub(b.lastMetrics.syncTime).Seconds()
passedTime := now.Sub(b.lastMetrics.SyncTime).Seconds()
nm.NetworkReceiveBytesRate = (nm.NetworkReceiveBytesTotal - b.lastMetrics.NetworkReceiveBytesTotal) / passedTime
nm.NetworkTransmitBytesRate = (nm.NetworkTransmitBytesTotal - b.lastMetrics.NetworkTransmitBytesTotal) / passedTime
}
@@ -272,7 +272,7 @@ func (b *readerImpl) ReadOnce(ctx context.Context) (*NodeMetrics, error) {
if err != nil {
return nil, err
}
nm := &NodeMetrics{syncTime: time.Now(), PingMetrics: []PingMetric{}}
nm := &NodeMetrics{SyncTime: time.Now(), PingMetrics: []PingMetric{}}
if err := b.parseCpuInfo(parsed, nm); err != nil {
return nil, err
}

View File

@@ -29,7 +29,7 @@ type NodeMetrics struct {
// ping
PingMetrics []PingMetric `json:"ping_metrics"`
syncTime time.Time
SyncTime time.Time
}
type PingMetric struct {