private static void mapBlockStats(ProfileDetail profileDetail, StatsInfo statsInfo) { for (BlockStats blockStat: statsInfo.getBlockStats()) { BlockStatistic bStat = new BlockStatistic(); bStat.setStatistics(new Statistics()); bStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(BLOCK_SIZE), blockStat.getSize())); bStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(BYTES_BLOCK_READ), blockStat.getBlockRead())); bStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(BYTES_BLOCK_WRITE), blockStat.getBlockWrite())); profileDetail.setBlockStatistics(new BlockStatistics()); profileDetail.getBlockStatistics().getBlockStatistics().add(bStat); } }
@Override public V3ProfileDetail adapt(ProfileDetail from) { V3ProfileDetail to = new V3ProfileDetail(); if (from.isSetBlockStatistics()) { to.getBlockStatistic().addAll(adaptOut(from.getBlockStatistics().getBlockStatistics())); } if (from.isSetDuration()) { to.setDuration(from.getDuration()); } if (from.isSetFopStatistics()) { to.getFopStatistic().addAll(adaptOut(from.getFopStatistics().getFopStatistics())); } if (from.isSetProfileType()) { to.setProfileType(from.getProfileType()); } if (from.isSetStatistics()) { to.getStatistic().addAll(adaptOut(from.getStatistics().getStatistics())); } return to; } }
@Override public ProfileDetail adapt(V3ProfileDetail from) { ProfileDetail to = new ProfileDetail(); if (from.isSetBlockStatistic()) { to.setBlockStatistics(new BlockStatistics()); to.getBlockStatistics().getBlockStatistics().addAll(adaptIn(from.getBlockStatistic())); } if (from.isSetDuration()) { to.setDuration(from.getDuration()); } if (from.isSetFopStatistic()) { to.setFopStatistics(new FopStatistics()); to.getFopStatistics().getFopStatistics().addAll(adaptIn(from.getFopStatistic())); } if (from.isSetProfileType()) { to.setProfileType(from.getProfileType()); } if (from.isSetStatistic()) { to.setStatistics(new Statistics()); to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistic())); } return to; } }