@Override public CanaryScope buildCanaryScope(CanaryScope canaryScope) { Map<String, String> extendedParameters = Optional.ofNullable(canaryScope.getExtendedScopeParams()) .orElseThrow(() -> new IllegalArgumentException("New Relic requires extended parameters")); NewRelicCanaryScope newRelicCanaryScope = new NewRelicCanaryScope(); newRelicCanaryScope.setScope(canaryScope.getScope()); newRelicCanaryScope.setStart(canaryScope.getStart()); newRelicCanaryScope.setEnd(canaryScope.getEnd()); newRelicCanaryScope.setStep(canaryScope.getStep()); newRelicCanaryScope.setExtendedScopeParams(extendedParameters); newRelicCanaryScope.setScopeKey(getRequiredExtendedParam(SCOPE_KEY_KEY, extendedParameters)); return newRelicCanaryScope; }
Instant.ofEpochMilli(timeSeries.getMetadata().getEndTimeMillis()); Duration stepDuration = Duration.ofSeconds(canaryScope.getStep()); if (stepDuration.isZero()) { stepDuration = calculateStepDuration(timeSeries);
stackdriverCanaryScope.setStart(canaryScope.getStart()); stackdriverCanaryScope.setEnd(canaryScope.getEnd()); stackdriverCanaryScope.setStep(canaryScope.getStep()); stackdriverCanaryScope.setExtendedScopeParams(canaryScope.getExtendedScopeParams());
@Override public CanaryScope buildCanaryScope(CanaryScope canaryScope) { SignalFxCanaryScope signalFxCanaryScope = new SignalFxCanaryScope(); signalFxCanaryScope.setScope(canaryScope.getScope()); signalFxCanaryScope.setLocation(canaryScope.getLocation()); signalFxCanaryScope.setStart(canaryScope.getStart()); signalFxCanaryScope.setEnd(canaryScope.getEnd()); signalFxCanaryScope.setStep(canaryScope.getStep()); Optional.ofNullable(canaryScope.getExtendedScopeParams()).ifPresent(extendedParameters -> { signalFxCanaryScope.setScopeKey(extendedParameters.getOrDefault(SCOPE_KEY_KEY, null)); signalFxCanaryScope.setLocationKey(extendedParameters.getOrDefault(LOCATION_KEY_KEY, null)); signalFxCanaryScope.setExtendedScopeParams(extendedParameters); }); return signalFxCanaryScope; } }
@Override public CanaryScope buildCanaryScope(CanaryScope canaryScope){ AtlasCanaryScope atlasCanaryScope = new AtlasCanaryScope(); atlasCanaryScope.setScope(canaryScope.getScope()); atlasCanaryScope.setLocation(canaryScope.getLocation()); atlasCanaryScope.setStart(canaryScope.getStart()); atlasCanaryScope.setEnd(canaryScope.getEnd()); atlasCanaryScope.setStep(canaryScope.getStep()); atlasCanaryScope.setExtendedScopeParams(canaryScope.getExtendedScopeParams()); Map<String, String> extendedScopeParams = atlasCanaryScope.getExtendedScopeParams(); if (extendedScopeParams == null) { extendedScopeParams = Collections.emptyMap(); } atlasCanaryScope.setType(extendedScopeParams.getOrDefault("type", "cluster")); atlasCanaryScope.setDeployment(extendedScopeParams.getOrDefault("deployment", "main")); atlasCanaryScope.setDataset(extendedScopeParams.getOrDefault("dataset", "regional")); atlasCanaryScope.setEnvironment(extendedScopeParams.getOrDefault("environment", "test")); return atlasCanaryScope; } }
@Override public CanaryScope buildCanaryScope(CanaryScope canaryScope){ PrometheusCanaryScope prometheusCanaryScope = new PrometheusCanaryScope(); prometheusCanaryScope.setScope(canaryScope.getScope()); prometheusCanaryScope.setLocation(canaryScope.getLocation()); prometheusCanaryScope.setStart(canaryScope.getStart()); prometheusCanaryScope.setEnd(canaryScope.getEnd()); prometheusCanaryScope.setStep(canaryScope.getStep()); prometheusCanaryScope.setExtendedScopeParams(canaryScope.getExtendedScopeParams()); Map<String, String> extendedScopeParams = prometheusCanaryScope.getExtendedScopeParams(); if (extendedScopeParams != null) { if (extendedScopeParams.containsKey("project")) { prometheusCanaryScope.setProject(extendedScopeParams.get("project")); } if (extendedScopeParams.containsKey("resourceType")) { prometheusCanaryScope.setResourceType(extendedScopeParams.get("resourceType")); } } return prometheusCanaryScope; } }
canaryScope.getStart().toString(), canaryScope.getEnd().toString(), canaryScope.getStep()); } finally { long endTime = registry.clock().monotonicTime(); .endTimeMillis(canaryScope.getEnd().toEpochMilli()) .endTimeIso(canaryScope.getEnd().toString()) .stepMillis(TimeUnit.SECONDS.toMillis(canaryScope.getStep())) .values(Collections.emptyList());
@Override public CanaryScope buildCanaryScope(CanaryScope canaryScope) { Map<String, String> extendedParameters = Optional.ofNullable(canaryScope.getExtendedScopeParams()) .orElseThrow(() -> new IllegalArgumentException("New Relic requires extended parameters")); NewRelicCanaryScope newRelicCanaryScope = new NewRelicCanaryScope(); newRelicCanaryScope.setScope(canaryScope.getScope()); newRelicCanaryScope.setStart(canaryScope.getStart()); newRelicCanaryScope.setEnd(canaryScope.getEnd()); newRelicCanaryScope.setStep(canaryScope.getStep()); newRelicCanaryScope.setExtendedScopeParams(extendedParameters); newRelicCanaryScope.setScopeKey(getRequiredExtendedParam(SCOPE_KEY_KEY, extendedParameters)); return newRelicCanaryScope; }
@Override public CanaryScope buildCanaryScope(CanaryScope scope) { WavefrontCanaryScope wavefrontCanaryScope = new WavefrontCanaryScope(); wavefrontCanaryScope.setScope(scope.getScope()); wavefrontCanaryScope.setLocation(scope.getLocation()); wavefrontCanaryScope.setStart(scope.getStart()); wavefrontCanaryScope.setEnd(scope.getEnd()); wavefrontCanaryScope.setStep(scope.getStep()); wavefrontCanaryScope.setGranularity(generateGranularity(scope.getStep())); wavefrontCanaryScope.setExtendedScopeParams(scope.getExtendedScopeParams()); return wavefrontCanaryScope; }
stackdriverCanaryScope.setStart(canaryScope.getStart()); stackdriverCanaryScope.setEnd(canaryScope.getEnd()); stackdriverCanaryScope.setStep(canaryScope.getStep()); stackdriverCanaryScope.setExtendedScopeParams(canaryScope.getExtendedScopeParams());
@Override public CanaryScope buildCanaryScope(CanaryScope canaryScope) { SignalFxCanaryScope signalFxCanaryScope = new SignalFxCanaryScope(); signalFxCanaryScope.setScope(canaryScope.getScope()); signalFxCanaryScope.setLocation(canaryScope.getLocation()); signalFxCanaryScope.setStart(canaryScope.getStart()); signalFxCanaryScope.setEnd(canaryScope.getEnd()); signalFxCanaryScope.setStep(canaryScope.getStep()); Optional.ofNullable(canaryScope.getExtendedScopeParams()).ifPresent(extendedParameters -> { signalFxCanaryScope.setScopeKey(extendedParameters.getOrDefault(SCOPE_KEY_KEY, null)); signalFxCanaryScope.setLocationKey(extendedParameters.getOrDefault(LOCATION_KEY_KEY, null)); signalFxCanaryScope.setExtendedScopeParams(extendedParameters); }); return signalFxCanaryScope; } }
Instant.ofEpochMilli(timeSeries.getMetadata().getEndTimeMillis()); Duration stepDuration = Duration.ofSeconds(canaryScope.getStep()); if (stepDuration.isZero()) { stepDuration = calculateStepDuration(timeSeries);
@Override public CanaryScope buildCanaryScope(CanaryScope canaryScope){ AtlasCanaryScope atlasCanaryScope = new AtlasCanaryScope(); atlasCanaryScope.setScope(canaryScope.getScope()); atlasCanaryScope.setLocation(canaryScope.getLocation()); atlasCanaryScope.setStart(canaryScope.getStart()); atlasCanaryScope.setEnd(canaryScope.getEnd()); atlasCanaryScope.setStep(canaryScope.getStep()); atlasCanaryScope.setExtendedScopeParams(canaryScope.getExtendedScopeParams()); Map<String, String> extendedScopeParams = atlasCanaryScope.getExtendedScopeParams(); if (extendedScopeParams == null) { extendedScopeParams = Collections.emptyMap(); } atlasCanaryScope.setType(extendedScopeParams.getOrDefault("type", "cluster")); atlasCanaryScope.setDeployment(extendedScopeParams.getOrDefault("deployment", "main")); atlasCanaryScope.setDataset(extendedScopeParams.getOrDefault("dataset", "regional")); atlasCanaryScope.setEnvironment(extendedScopeParams.getOrDefault("environment", "test")); return atlasCanaryScope; } }
@Override public CanaryScope buildCanaryScope(CanaryScope canaryScope){ PrometheusCanaryScope prometheusCanaryScope = new PrometheusCanaryScope(); prometheusCanaryScope.setScope(canaryScope.getScope()); prometheusCanaryScope.setLocation(canaryScope.getLocation()); prometheusCanaryScope.setStart(canaryScope.getStart()); prometheusCanaryScope.setEnd(canaryScope.getEnd()); prometheusCanaryScope.setStep(canaryScope.getStep()); prometheusCanaryScope.setExtendedScopeParams(canaryScope.getExtendedScopeParams()); Map<String, String> extendedScopeParams = prometheusCanaryScope.getExtendedScopeParams(); if (extendedScopeParams != null) { if (extendedScopeParams.containsKey("project")) { prometheusCanaryScope.setProject(extendedScopeParams.get("project")); } if (extendedScopeParams.containsKey("resourceType")) { prometheusCanaryScope.setResourceType(extendedScopeParams.get("resourceType")); } } return prometheusCanaryScope; } }
canaryScope.getStart().toString(), canaryScope.getEnd().toString(), canaryScope.getStep()); } finally { long endTime = registry.clock().monotonicTime(); .endTimeMillis(canaryScope.getEnd().toEpochMilli()) .endTimeIso(canaryScope.getEnd().toString()) .stepMillis(TimeUnit.SECONDS.toMillis(canaryScope.getStep())) .values(Collections.emptyList());