Java 类com.vmware.vim25.PerfSampleInfo 实例源码

项目:photon-model    文件:DailyAggregator.java   
@Override
public ServiceStat createStat(PerfCounterInfo pc, List<PerfSampleInfo> infos,
        List<Long> values) {

    if (infos == null || infos.isEmpty()) {
        return null;
    }

    ServiceStat res = new ServiceStat();

    res.name = this.name;
    res.unit = this.unit;

    PerfSampleInfo info = null;
    double converted = 0;

    int intervalLengthMinutes = 5;
    res.timeSeriesStats = new TimeSeriesStats(24 * 60 / intervalLengthMinutes,
            intervalLengthMinutes * 60 * 1000,
            EnumSet.allOf(AggregationType.class));

    for (int i = 0; i < infos.size(); i++) {
        info = infos.get(i);
        Long value = values.get(i);

        converted = convertValue(value);
        res.timeSeriesStats.add(getSampleTimestampMicros(info), converted, converted);
    }

    res.sourceTimeMicrosUtc = res.lastUpdateMicrosUtc = getSampleTimestampMicros(info);
    res.latestValue = converted;
    return res;
}
项目:photon-model    文件:DailyAggregator.java   
private long getSampleTimestampMicros(PerfSampleInfo info) {
    return info.getTimestamp().toGregorianCalendar().getTimeInMillis() * 1000;
}
项目:photon-model    文件:SamplesAggregator.java   
ServiceStat createStat(PerfCounterInfo counter, List<PerfSampleInfo> infos, List<Long> data);