Search in sources :

Example 1 with Value

use of org.ovirt.engine.api.model.Value in project ovirt-engine by oVirt.

the class StatisticResourceUtils method setDatum.

public static Statistic setDatum(Statistic statistic, BigDecimal datum) {
    if (datum != null) {
        Value value = new Value();
        value.setDatum(datum);
        statistic.getValues().getValues().add(value);
    }
    return statistic;
}
Also used : Value(org.ovirt.engine.api.model.Value)

Example 2 with Value

use of org.ovirt.engine.api.model.Value in project ovirt-engine by oVirt.

the class StatisticResourceUtils method setDatum.

public static Statistic setDatum(Statistic statistic, String datum) {
    if (datum != null) {
        Value value = new Value();
        value.setDetail(datum);
        statistic.getValues().getValues().add(value);
    }
    return statistic;
}
Also used : Value(org.ovirt.engine.api.model.Value)

Example 3 with Value

use of org.ovirt.engine.api.model.Value in project ovirt-engine by oVirt.

the class BackendStatisticsResourceTest method getPrototype.

static Statistic getPrototype(String name) {
    Statistic statistic = new Statistic();
    statistic.setName(name);
    statistic.setId(UUID.nameUUIDFromBytes(statistic.getName().getBytes()).toString());
    statistic.setUnit(StatisticUnit.BYTES);
    statistic.setKind(StatisticKind.GAUGE);
    Value value = new Value();
    statistic.setValues(new Values());
    statistic.setType(ValueType.INTEGER);
    statistic.getValues().getValues().add(value);
    statistic.setHost(new Host());
    statistic.getHost().setId(GUIDS[2].toString());
    return statistic;
}
Also used : Statistic(org.ovirt.engine.api.model.Statistic) Value(org.ovirt.engine.api.model.Value) Values(org.ovirt.engine.api.model.Values) Host(org.ovirt.engine.api.model.Host)

Aggregations

Value (org.ovirt.engine.api.model.Value)3 Host (org.ovirt.engine.api.model.Host)1 Statistic (org.ovirt.engine.api.model.Statistic)1 Values (org.ovirt.engine.api.model.Values)1