Search in sources :

Example 1 with SimpleMetricDto

use of ee.ria.xroad.monitor.common.dto.SimpleMetricDto in project X-Road by nordic-institute.

the class MetricTypes method of.

/**
 * MetricSetType factory
 */
public static MetricSetType of(MetricSetDto metrics) {
    final MetricSetType metricSet = new MetricSetType();
    metricSet.setName(metrics.getName());
    for (MetricDto metricDto : metrics.getMetrics()) {
        if (metricDto instanceof MetricSetDto) {
            metricSet.getMetrics().add(of((MetricSetDto) metricDto));
        } else if (metricDto instanceof HistogramDto) {
            metricSet.getMetrics().add(toMetricType((HistogramDto) metricDto));
        } else if (metricDto instanceof SimpleMetricDto) {
            metricSet.getMetrics().add(toMetricType((SimpleMetricDto<?>) metricDto));
        }
    }
    return metricSet;
}
Also used : HistogramDto(ee.ria.xroad.monitor.common.dto.HistogramDto) MetricDto(ee.ria.xroad.monitor.common.dto.MetricDto) SimpleMetricDto(ee.ria.xroad.monitor.common.dto.SimpleMetricDto) SimpleMetricDto(ee.ria.xroad.monitor.common.dto.SimpleMetricDto) MetricSetDto(ee.ria.xroad.monitor.common.dto.MetricSetDto) MetricSetType(ee.ria.xroad.proxymonitor.message.MetricSetType)

Aggregations

HistogramDto (ee.ria.xroad.monitor.common.dto.HistogramDto)1 MetricDto (ee.ria.xroad.monitor.common.dto.MetricDto)1 MetricSetDto (ee.ria.xroad.monitor.common.dto.MetricSetDto)1 SimpleMetricDto (ee.ria.xroad.monitor.common.dto.SimpleMetricDto)1 MetricSetType (ee.ria.xroad.proxymonitor.message.MetricSetType)1