Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.teradata.benchto.driver;
import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
import com.teradata.benchto.driver.graphite.GraphiteProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkState;
import static com.teradata.benchto.driver.utils.PropertiesUtils.extractPaths;
import static com.teradata.benchto.driver.utils.PropertiesUtils.splitProperty;
import static java.util.stream.Collectors.toMap;
@Component
public class BenchmarkProperties
{
@Value("${sql}")
private String sqlDirs;
@Value("${benchmarks}")
private String benchmarksDirs;
@Value("${overrides:#{null}}")
private String overridesPath;
/**
* Active benchmarks. If this property is set benchmarks will be filtered by name.
*/
@Value("${activeBenchmarks:#{null}}")
private String activeBenchmarks;
/**
* Active variables. If this property is set benchmarks will be filtered by their variable content.
*/
@Value("${activeVariables:#{null}}")
private String activeVariables;
/**
* Execution identifier. Should be unique between runs. If not set, it will be automatically set based on timestamp.
*/
@Value("${executionSequenceId:#{null}}")
private String executionSequenceId;
@Value("${environment.name}")
private String environmentName;
@Value("${macroExecutions.healthCheck:#{null}}")
private String healthCheckMacros;
@Value("${macroExecutions.beforeAll:#{null}}")
private String beforeAllMacros;
@Value("${macroExecutions.afterAll:#{null}}")
private String afterAllMacros;
@Value("${timeLimit:#{null}}")
private String timeLimit;
@Value("${frequencyCheckEnabled:true}")
private String frequencyCheckEnabled;
@Autowired
private GraphiteProperties graphiteProperties;
public List sqlFilesDirs()
{
return extractPaths(sqlDirs);
}
public List benchmarksFilesDirs()
{
return extractPaths(benchmarksDirs);
}
public Optional getOverridesPath()
{
return Optional.ofNullable(overridesPath).map(Paths::get);
}
public Optional getExecutionSequenceId()
{
return Optional.ofNullable(executionSequenceId);
}
public String getEnvironmentName()
{
return environmentName;
}
public Optional> getActiveBenchmarks()
{
return splitProperty(activeBenchmarks);
}
public Optional