public static ContainerStats calculateStatsValues(String statsJson){
  ContainerStats state=new ContainerStats();
  if (statsJson == null || statsJson.isEmpty()) {
    return state;
  }
  Map<String,JsonElement> stats=parseStats(statsJson);
  calculateCpuUsage(state,stats);
  setMemoryUsage(state,stats);
  setNetworkUsage(state,stats);
  setContainerStopped(state,stats);
  return state;
}

public static ContainerStats calculateStatsValues ( String statsJson ) { ContainerStats state = new ContainerStats ( ) ; if ( statsJson == null || statsJson . isEmpty ( ) ) { return state ; } Map < String , JsonElement > stats = parseStats ( statsJson ) ; calculateCpuUsage ( state , stats ) ; setMemoryUsage ( state , stats ) ; setNetworkUsage ( state , stats ) ; setContainerStopped ( state , stats ) ; return state ; }
parse the json stats value and return containerstats state with the calculated values from the json field .
