5523: Say "notice" instead of "error" when stats file changes/appears/disappears.
authorTom Clegg <tom@curoverse.com>
Wed, 6 May 2015 14:09:21 +0000 (10:09 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 6 May 2015 14:09:21 +0000 (10:09 -0400)
services/crunchstat/crunchstat.go

index 1a22e264f1ab734dafe052a589f86bfc2be6597e..198222371613583291ee50a973853686ff87a74c 100644 (file)
@@ -110,12 +110,14 @@ func OpenStatFile(cgroup Cgroup, statgroup string, stat string) (*os.File, error
                // whether we happen to collect stats [a] before any
                // processes have been created in the container and
                // [b] after all contained processes have exited.
-               reportedStatFile[stat] = path
                if path == "" {
-                       statLog.Printf("error finding stats file: stat %s, statgroup %s, cid %s, parent %s, root %s\n", stat, statgroup, cgroup.cid, cgroup.parent, cgroup.root)
+                       statLog.Printf("notice: stats not available: stat %s, statgroup %s, cid %s, parent %s, root %s\n", stat, statgroup, cgroup.cid, cgroup.parent, cgroup.root)
+               } else if ok {
+                       statLog.Printf("notice: stats moved from %s to %s\n", reportedStatFile[stat], path)
                } else {
-                       statLog.Printf("error reading stats from %s\n", path)
+                       statLog.Printf("notice: reading stats from %s\n", path)
                }
+               reportedStatFile[stat] = path
        }
        return file, err
 }