[ARVADOS] created: 1.3.0-545-ga164de7ba

Git user git at public.curoverse.com
Tue Mar 19 19:50:16 UTC 2019


        at  a164de7bab103dd073ddd1aeec086fc565a67347 (commit)


commit a164de7bab103dd073ddd1aeec086fc565a67347
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Tue Mar 19 15:49:49 2019 -0400

    14998: Report total_* (hierarchy) stats if available.
    
    Otherwise, host stats only include the root cgroup.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/lib/crunchstat/crunchstat.go b/lib/crunchstat/crunchstat.go
index 8afe82819..028083fa0 100644
--- a/lib/crunchstat/crunchstat.go
+++ b/lib/crunchstat/crunchstat.go
@@ -256,8 +256,13 @@ func (r *Reporter) doMemoryStats() {
 	}
 	var outstat bytes.Buffer
 	for _, key := range wantStats {
-		if val, ok := thisSample.memStat[key]; ok {
-			outstat.WriteString(fmt.Sprintf(" %d %s", val, key))
+		// Use "total_X" stats (entire hierarchy) if enabled,
+		// otherwise just the single cgroup -- see
+		// https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
+		if val, ok := thisSample.memStat["total_"+key]; ok {
+			fmt.Fprintf(&outstat, " %d %s", val, key)
+		} else if val, ok := thisSample.memStat[key]; ok {
+			fmt.Fprintf(&outstat, " %d %s", val, key)
 		}
 	}
 	r.Logger.Printf("mem%s\n", outstat.String())

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list