@Override public List<MetricSet> queryMetrics(String accountName, CanaryConfig canaryConfig, CanaryMetricConfig canaryMetricConfig, CanaryScope canaryScope) { InfluxDbNamedAccountCredentials accountCredentials = (InfluxDbNamedAccountCredentials)accountCredentialsRepository .getOne(accountName) .orElseThrow(() -> new IllegalArgumentException("Unable to resolve account " + accountName + ".")); InfluxDbRemoteService remoteService = accountCredentials.getInfluxDbRemoteService(); InfluxdbCanaryMetricSetQueryConfig queryConfig = (InfluxdbCanaryMetricSetQueryConfig)canaryMetricConfig.getQuery(); String query = queryBuilder.build(queryConfig, canaryScope); log.debug("query={}", query); String metricSetName = canaryMetricConfig.getName(); List<InfluxDbResult> influxDbResults = queryInfluxdb(remoteService, metricSetName, query); return buildMetricSets(metricSetName, influxDbResults); }
CanaryScopeFactory canaryScopeFactory = getScopeFactoryForServiceType(serviceType); if (metric.getScopeName() == null) { throw new IllegalArgumentException("Canary scope for metric named '" + metric.getName() + "' is null.");
metricSets.add( MetricSet.builder() .name(canaryMetricConfig.getName()) .startTimeMillis(entry.getStartMills()) .startTimeIso(Instant.ofEpochSecond(entry.getStart()).toString())
.name(canaryMetricConfig.getName()) .startTimeMillis(startEpochMilli) .startTimeIso(Instant.ofEpochMilli(startEpochMilli).toString())
.name(canaryMetricConfig.getName()) .startTimeMillis(begin.toEpochMilli()) .startTimeIso(begin.toString())
ret.add( MetricSet.builder() .name(canaryMetricConfig.getName()) .startTimeMillis(series.getStart()) .startTimeIso(Instant.ofEpochMilli(series.getStart()).toString())
MetricSet.MetricSetBuilder metricSetBuilder = MetricSet.builder() .name(canaryMetricConfig.getName()) .startTimeMillis(prometheusResults.getStartTimeMillis()) .startTimeIso(responseStartTimeInstant.toString()) MetricSet.MetricSetBuilder metricSetBuilder = MetricSet.builder() .name(canaryMetricConfig.getName()) .startTimeMillis(canaryScope.getStart().toEpochMilli()) .startTimeIso(canaryScope.getStart().toString())
.name(canaryMetricConfig.getName()) .startTimeMillis(responseStartTimeMillis) .startTimeIso(responseStartTimeInstant.toString())
CanaryScopeFactory canaryScopeFactory = getScopeFactoryForServiceType(serviceType); if (metric.getScopeName() == null) { throw new IllegalArgumentException("Canary scope for metric named '" + metric.getName() + "' is null.");
@Override public List<MetricSet> queryMetrics(String accountName, CanaryConfig canaryConfig, CanaryMetricConfig canaryMetricConfig, CanaryScope canaryScope) { InfluxDbNamedAccountCredentials accountCredentials = (InfluxDbNamedAccountCredentials)accountCredentialsRepository .getOne(accountName) .orElseThrow(() -> new IllegalArgumentException("Unable to resolve account " + accountName + ".")); InfluxDbRemoteService remoteService = accountCredentials.getInfluxDbRemoteService(); InfluxdbCanaryMetricSetQueryConfig queryConfig = (InfluxdbCanaryMetricSetQueryConfig)canaryMetricConfig.getQuery(); String query = queryBuilder.build(queryConfig, canaryScope); log.debug("query={}", query); String metricSetName = canaryMetricConfig.getName(); List<InfluxDbResult> influxDbResults = queryInfluxdb(remoteService, metricSetName, query); return buildMetricSets(metricSetName, influxDbResults); }
metricSets.add( MetricSet.builder() .name(canaryMetricConfig.getName()) .startTimeMillis(entry.getStartMills()) .startTimeIso(Instant.ofEpochSecond(entry.getStart()).toString())
.name(canaryMetricConfig.getName()) .startTimeMillis(startEpochMilli) .startTimeIso(Instant.ofEpochMilli(startEpochMilli).toString())
.name(canaryMetricConfig.getName()) .startTimeMillis(begin.toEpochMilli()) .startTimeIso(begin.toString())
ret.add( MetricSet.builder() .name(canaryMetricConfig.getName()) .startTimeMillis(series.getStart()) .startTimeIso(Instant.ofEpochMilli(series.getStart()).toString())
Long responseEndTime = seriesDate.get(seriesDate.size() - 1).get(0).longValue(); MetricSet.MetricSetBuilder metricSetBuilder = MetricSet.builder() .name(canaryMetricConfig.getName()) .startTimeMillis(TimeUnit.SECONDS.toMillis(responseStartTime)) .startTimeIso(Instant.ofEpochSecond(responseStartTime).toString())
MetricSet.MetricSetBuilder metricSetBuilder = MetricSet.builder() .name(canaryMetricConfig.getName()) .startTimeMillis(prometheusResults.getStartTimeMillis()) .startTimeIso(responseStartTimeInstant.toString()) MetricSet.MetricSetBuilder metricSetBuilder = MetricSet.builder() .name(canaryMetricConfig.getName()) .startTimeMillis(canaryScope.getStart().toEpochMilli()) .startTimeIso(canaryScope.getStart().toString())
.name(canaryMetricConfig.getName()) .startTimeMillis(responseStartTimeMillis) .startTimeIso(responseStartTimeInstant.toString())