From 5819c81f1afc1c1dec2315e28ecdf604e035ecbf Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Fri, 5 Apr 2024 17:44:24 +0200 Subject: [PATCH] Revert add avgRTT to nfs mountstats #487 (#625) This is an artificiality computed value from existing values. The goal of this library is to provide simple raw access to values, rather than pre-compute data. Reverts: https://github.com/prometheus/procfs/pull/487 Signed-off-by: SuperQ --- mountstats.go | 5 ----- mountstats_test.go | 3 --- 2 files changed, 8 deletions(-) diff --git a/mountstats.go b/mountstats.go index 9d8af6db..d2032d8d 100644 --- a/mountstats.go +++ b/mountstats.go @@ -194,8 +194,6 @@ type NFSOperationStats struct { CumulativeTotalResponseMilliseconds uint64 // Duration from when a request was enqueued to when it was completely handled. CumulativeTotalRequestMilliseconds uint64 - // The average time from the point the client sends RPC requests until it receives the response. - AverageRTTMilliseconds float64 // The count of operations that complete with tk_status < 0. These statuses usually indicate error conditions. Errors uint64 } @@ -582,9 +580,6 @@ func parseNFSOperationStats(s *bufio.Scanner) ([]NFSOperationStats, error) { CumulativeTotalResponseMilliseconds: ns[6], CumulativeTotalRequestMilliseconds: ns[7], } - if ns[0] != 0 { - opStats.AverageRTTMilliseconds = float64(ns[6]) / float64(ns[0]) - } if len(ns) > 8 { opStats.Errors = ns[8] diff --git a/mountstats_test.go b/mountstats_test.go index 43903e9e..f9588f02 100644 --- a/mountstats_test.go +++ b/mountstats_test.go @@ -339,7 +339,6 @@ func TestMountStats(t *testing.T) { CumulativeQueueMilliseconds: 6, CumulativeTotalResponseMilliseconds: 79386, CumulativeTotalRequestMilliseconds: 79407, - AverageRTTMilliseconds: 61.16024653312789, }, { Operation: "WRITE", @@ -353,7 +352,6 @@ func TestMountStats(t *testing.T) { CumulativeQueueMilliseconds: 18446743919241604546, CumulativeTotalResponseMilliseconds: 1667369447, CumulativeTotalRequestMilliseconds: 1953587717, - AverageRTTMilliseconds: 0.5695744656983355, }, }, Transport: NFSTransportStats{ @@ -427,7 +425,6 @@ func TestMountStats(t *testing.T) { CumulativeQueueMilliseconds: 320, CumulativeTotalResponseMilliseconds: 11, CumulativeTotalRequestMilliseconds: 331, - AverageRTTMilliseconds: 0.6875, Errors: 0, }, },