protected Map<String, CanaryScopePair> buildRequestScopes(CanaryAnalysisExecutionRequest config, long interval, Duration intervalDuration) { Map<String, CanaryScopePair> scopes = new HashMap<>(); config.getScopes().forEach(scope -> { ScopeTimeConfig scopeTimeConfig = calculateStartAndEndForJudgement(config, interval, intervalDuration); CanaryScope controlScope = new CanaryScope( scope.getControlScope(), scope.getControlLocation(), scopeTimeConfig.start, scopeTimeConfig.end, config.getStep().getSeconds(), scope.getExtendedScopeParams() ); CanaryScope experimentScope = new CanaryScope( scope.getExperimentScope(), scope.getExperimentLocation(), scopeTimeConfig.start, scopeTimeConfig.end, config.getStep().getSeconds(), scope.getExtendedScopeParams() ); CanaryScopePair canaryScopePair = new CanaryScopePair() .setControlScope(controlScope) .setExperimentScope(experimentScope); scopes.put(scope.getScopeName(), canaryScopePair); }); return scopes; }
protected Map<String, CanaryScopePair> buildRequestScopes(CanaryAnalysisExecutionRequest config, long interval, Duration intervalDuration) { Map<String, CanaryScopePair> scopes = new HashMap<>(); config.getScopes().forEach(scope -> { ScopeTimeConfig scopeTimeConfig = calculateStartAndEndForJudgement(config, interval, intervalDuration); CanaryScope controlScope = new CanaryScope( scope.getControlScope(), scope.getControlLocation(), scopeTimeConfig.start, scopeTimeConfig.end, config.getStep().getSeconds(), scope.getExtendedScopeParams() ); CanaryScope experimentScope = new CanaryScope( scope.getExperimentScope(), scope.getExperimentLocation(), scopeTimeConfig.start, scopeTimeConfig.end, config.getStep().getSeconds(), scope.getExtendedScopeParams() ); CanaryScopePair canaryScopePair = new CanaryScopePair() .setControlScope(controlScope) .setExperimentScope(experimentScope); scopes.put(scope.getScopeName(), canaryScopePair); }); return scopes; }