Implement CgroupsInfoCollector that collects information from the CgroupsInfo about each process.

TODO: Extract out common interface between CgroupsInfoCollector and PsInfoCollector - the WorkerProcessMetricsCollector should be passed an interface and should not care what resource collector it is using.
PiperOrigin-RevId: 605269981
Change-Id: Ie2afedf01a84a6bc046aab072d8ef9d35fe3517d
diff --git a/src/main/java/com/google/devtools/build/lib/metrics/ResourceSnapshot.java b/src/main/java/com/google/devtools/build/lib/metrics/ResourceSnapshot.java
index 99009f7..5a3d693 100644
--- a/src/main/java/com/google/devtools/build/lib/metrics/ResourceSnapshot.java
+++ b/src/main/java/com/google/devtools/build/lib/metrics/ResourceSnapshot.java
@@ -32,7 +32,7 @@
     return new AutoValue_ResourceSnapshot(pidToMemoryInKb, collectionTime);
   }
 
-  public static ResourceSnapshot createEmpty() {
-    return new AutoValue_ResourceSnapshot(ImmutableMap.of(), Instant.now());
+  public static ResourceSnapshot createEmpty(Instant collectionTime) {
+    return new AutoValue_ResourceSnapshot(ImmutableMap.of(), collectionTime);
   }
 }