use of org.ovirt.engine.api.model.Statistic in project ovirt-engine by oVirt.
the class BackendVmDiskResource method addStatistics.
private void addStatistics(Disk model, org.ovirt.engine.core.common.businessentities.storage.Disk entity) {
model.setStatistics(new Statistics());
DiskStatisticalQuery query = new DiskStatisticalQuery(newModel(model.getId()));
List<Statistic> statistics = query.getStatistics(entity);
for (Statistic statistic : statistics) {
LinkHelper.addLinks(statistic, query.getParentType());
}
model.getStatistics().getStatistics().addAll(statistics);
}
use of org.ovirt.engine.api.model.Statistic in project ovirt-engine by oVirt.
the class BackendVmDisksResource method addStatistics.
private void addStatistics(Disk model, org.ovirt.engine.core.common.businessentities.storage.Disk entity) {
model.setStatistics(new Statistics());
DiskStatisticalQuery query = new DiskStatisticalQuery(newModel(model.getId()));
List<Statistic> statistics = query.getStatistics(entity);
for (Statistic statistic : statistics) {
LinkHelper.addLinks(statistic, query.getParentType());
}
model.getStatistics().getStatistics().addAll(statistics);
}
use of org.ovirt.engine.api.model.Statistic in project ovirt-engine by oVirt.
the class BackendVmResource method addStatistics.
private void addStatistics(Vm model, org.ovirt.engine.core.common.businessentities.VM entity) {
model.setStatistics(new Statistics());
VmStatisticalQuery query = new VmStatisticalQuery(newModel(model.getId()));
List<Statistic> statistics = query.getStatistics(entity);
for (Statistic statistic : statistics) {
LinkHelper.addLinks(statistic, query.getParentType());
}
model.getStatistics().getStatistics().addAll(statistics);
}
use of org.ovirt.engine.api.model.Statistic in project ovirt-engine by oVirt.
the class StepStatisticalQuery method getStatistics.
@Override
public List<Statistic> getStatistics(GlusterVolumeTaskStatusEntity entity) {
List<Statistic> list = new ArrayList<>();
if (entity == null) {
return list;
}
for (GlusterVolumeTaskStatusForHost hostStatus : entity.getHostwiseStatusDetails()) {
Guid hostId = hostStatus.getHostId();
list.add(adopt(setHostDatum(FILES_MOVED, hostStatus.getFilesMoved(), hostId)));
list.add(adopt(setHostDatum(SIZE_MOVED, hostStatus.getTotalSizeMoved(), hostId)));
list.add(adopt(setHostDatum(FILES_SKIPPED, hostStatus.getFilesSkipped(), hostId)));
list.add(adopt(setHostDatum(FILES_SCANNED, hostStatus.getFilesScanned(), hostId)));
list.add(adopt(setHostDatum(FILES_FAILED, hostStatus.getFilesFailed(), hostId)));
list.add(adopt(setHostDatum(RUN_TIME, hostStatus.getRunTime(), hostId)));
list.add(adopt(setHostDatum(STATUS, hostStatus.getStatus().toString(), hostId)));
}
return list;
}
use of org.ovirt.engine.api.model.Statistic in project ovirt-engine by oVirt.
the class StepStatisticalQuery method setHostDatum.
private Statistic setHostDatum(Statistic stat, String value, Guid hostId) {
Statistic statistic = setDatum(clone(stat), value);
statistic.setHost(getHost(hostId));
return statistic;
}
Aggregations