public CpuAcctMetric snapshot ( ) { final File cpuacct ; try { cpuacct = new File ( cgroupDiscoverer . discover ( CGROUP ) . toFile ( ) , CGROUP_ACCT_FILE ) ; } catch ( RuntimeException re ) { LOG . error ( re , "Unable to fetch snapshot" ) ; return new CpuAcctMetric ( new long [ 0 ] , new long [ 0 ] ) ; } try { return parse ( Files . readAllLines ( cpuacct . toPath ( ) , StandardCharsets . UTF_8 ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Take a snapshot of the existing data .