use of org.ovirt.engine.core.common.businessentities.gluster.FopStats in project ovirt-engine by oVirt.
the class GetGlusterVolumeProfileInfoQueryTest method getFopStats.
private List<FopStats> getFopStats() {
FopStats fopStats = new FopStats();
fopStats.setAvgLatency(78.12500);
fopStats.setAvgLatencyFormatted(new Pair<>(78.12500, TimeUnit.MICROSECONDS.toString()));
fopStats.setName("STATFS");
fopStats.setHits(2);
fopStats.setMinLatency(39.00000);
fopStats.setMinLatencyFormatted(new Pair<>(39.00000, TimeUnit.MICROSECONDS.toString()));
fopStats.setMaxLatency(143.00000);
fopStats.setMaxLatencyFormatted(new Pair<>(143.00000, TimeUnit.MICROSECONDS.toString()));
return Collections.singletonList(fopStats);
}
use of org.ovirt.engine.core.common.businessentities.gluster.FopStats in project ovirt-engine by oVirt.
the class GlusterVolumeProfileInfoReturn method getFopStats.
private List<FopStats> getFopStats(Object[] fopStatsObjects) {
List<FopStats> fopStatsList = new ArrayList<>();
for (Object fopStatsObj : fopStatsObjects) {
FopStats fopStats = new FopStats();
Map<String, Object> fopStatsMap = (Map<String, Object>) fopStatsObj;
fopStats.setHits(Integer.parseInt((String) fopStatsMap.get(HITS)));
fopStats.setName((String) fopStatsMap.get(NAME));
Double minLatency = Double.valueOf((String) fopStatsMap.get(LATENCY_MIN));
fopStats.setMinLatency(minLatency);
Pair<Long, TimeUnit> minLatencyConverted = TimeConverter.autoConvert(minLatency.longValue(), TimeUnit.MICROSECONDS);
fopStats.setMinLatencyFormatted(new Pair<>(minLatencyConverted.getFirst().doubleValue(), minLatencyConverted.getSecond().toString()));
Double maxLatency = Double.valueOf((String) fopStatsMap.get(LATENCY_MAX));
fopStats.setMaxLatency(maxLatency);
Pair<Long, TimeUnit> maxLatencyConverted = TimeConverter.autoConvert(maxLatency.longValue(), TimeUnit.MICROSECONDS);
fopStats.setMaxLatencyFormatted(new Pair<>(maxLatencyConverted.getFirst().doubleValue(), maxLatencyConverted.getSecond().toString()));
Double avgLatency = Double.valueOf((String) fopStatsMap.get(LATENCY_AVG));
fopStats.setAvgLatency(avgLatency);
Pair<Long, TimeUnit> avgLatencyConverted = TimeConverter.autoConvert(avgLatency.longValue(), TimeUnit.MICROSECONDS);
fopStats.setAvgLatencyFormatted(new Pair<>(avgLatencyConverted.getFirst().doubleValue(), avgLatencyConverted.getSecond().toString()));
fopStatsList.add(fopStats);
}
return fopStatsList;
}
use of org.ovirt.engine.core.common.businessentities.gluster.FopStats in project ovirt-engine by oVirt.
the class GlusterVolumeProfileInfoMapper method mapFopStats.
private static void mapFopStats(ProfileDetail profileDetail, StatsInfo statsInfo) {
for (FopStats fopStat : statsInfo.getFopStats()) {
FopStatistic fStat = new FopStatistic();
fStat.setName(fopStat.getName());
fStat.setStatistics(new Statistics());
fStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(MIN_LATENCY), fopStat.getMinLatency()));
fStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(MAX_LATENCY), fopStat.getMaxLatency()));
fStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(AVG_LATENCY), fopStat.getAvgLatency()));
fStat.getStatistics().getStatistics().add(StatisticResourceUtils.setDatum(clone(HITS), fopStat.getHits()));
profileDetail.setFopStatistics(new FopStatistics());
profileDetail.getFopStatistics().getFopStatistics().add(fStat);
}
}
use of org.ovirt.engine.core.common.businessentities.gluster.FopStats in project ovirt-engine by oVirt.
the class VolumeProfileStatisticsPopupView method initEditors.
private void initEditors() {
nfsRefreshIcon = new RefreshActionIcon(SafeHtmlUtils.EMPTY_SAFE_HTML);
brickRefreshIcon = new RefreshActionIcon(SafeHtmlUtils.EMPTY_SAFE_HTML);
bricks = new ListModelListBoxEditor<>(new NameRenderer<BrickProfileDetails>());
nfsServers = new ListModelListBoxEditor<>(new NameRenderer<GlusterVolumeProfileStats>());
volumeProfileStats = new EntityModelCellTable<>(false, true);
volumeProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
return entity.getName();
}
}, constants.fileOperation());
volumeProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
return entity.getHits() + "";
}
}, constants.fOpInvocationCount());
volumeProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
// $NON-NLS-1$
return entity.getMaxLatencyFormatted().getFirst() + " " + entity.getMaxLatencyFormatted().getSecond();
}
}, constants.fOpMaxLatency());
volumeProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
// $NON-NLS-1$
return entity.getMinLatencyFormatted().getFirst() + " " + entity.getMinLatencyFormatted().getSecond();
}
}, constants.fOpMinLatency());
volumeProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
// $NON-NLS-1$
return entity.getAvgLatencyFormatted().getFirst() + " " + entity.getAvgLatencyFormatted().getSecond();
}
}, constants.fOpAvgLatency());
nfsServerProfileStats = new EntityModelCellTable<>(false, true);
nfsServerProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
return entity.getName();
}
}, constants.fileOperation());
nfsServerProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
return entity.getHits() + "";
}
}, constants.fOpInvocationCount());
nfsServerProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
// $NON-NLS-1$
return entity.getMaxLatencyFormatted().getFirst() + " " + entity.getMaxLatencyFormatted().getSecond();
}
}, constants.fOpMaxLatency());
nfsServerProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
// $NON-NLS-1$
return entity.getMinLatencyFormatted().getFirst() + " " + entity.getMinLatencyFormatted().getSecond();
}
}, constants.fOpMinLatency());
nfsServerProfileStats.addColumn(new AbstractEntityModelTextColumn<FopStats>() {
@Override
protected String getText(FopStats entity) {
// $NON-NLS-1$
return entity.getAvgLatencyFormatted().getFirst() + " " + entity.getAvgLatencyFormatted().getSecond();
}
}, constants.fOpAvgLatency());
}
Aggregations