本文整理汇总了Java中eu.atos.sla.evaluation.constraint.IConstraintEvaluator类的典型用法代码示例。如果您正苦于以下问题:Java IConstraintEvaluator类的具体用法?Java IConstraintEvaluator怎么用?Java IConstraintEvaluator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IConstraintEvaluator类属于eu.atos.sla.evaluation.constraint包,在下文中一共展示了IConstraintEvaluator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
now = new Date();
kpiName = "LATENCY";
constraint = kpiName + " LT 100";
contract = new Agreement();
contract.setAgreementId("agreement-test");
term = newGuaranteeTerm(kpiName, constraint);
values = new String[] { "102", "99", "99", "99", "101", "100", "99", "99" };
TestMetricsGenerator metricsGenerator = new TestMetricsGenerator(now, values);
allMetrics = metricsGenerator.getMetrics(kpiName);
IConstraintEvaluator constraintEval = new SimpleConstraintEvaluator();
evaluator = new GuaranteeTermEvaluator();
PoliciedServiceLevelEvaluator slEval =
new PoliciedServiceLevelEvaluator();
slEval.setConstraintEvaluator(constraintEval);
slEval.setBreachRepository(new DummyBreachRepository(constraint));
IBusinessValuesEvaluator bEval = new DummyBusinessValuesEvaluator();
evaluator.setServiceLevelEvaluator(slEval);
evaluator.setBusinessEvaluator(bEval);
}
示例2: testTranslate
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Test
public void testTranslate() throws IOException {
String json = readFile("/violation_2.0.1.json");
IConstraintEvaluator constraintEvaluator = new SimpleConstraintEvaluator();
ModacloudsTranslator translator = new ModacloudsTranslator(constraintEvaluator);
Agreement agreement = new Agreement();
GuaranteeTerm term = new GuaranteeTerm();
term.setKpiName("responsetime");
term.setName("rt");
term.setServiceLevel("WinVMCPUUtilization NOT_EXISTS");
agreement.setGuaranteeTerms(Arrays.asList(new IGuaranteeTerm[] { term}));
Map<IGuaranteeTerm, List<IMonitoringMetric>> map = translator.translate(agreement, json);
assertEquals(3, map.get(term).size());
}
示例3: testTranslateWrongAgreement
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Test
public void testTranslateWrongAgreement() throws IOException {
String json = readFile("/violation_ofbiz_2.0.1.json");
IConstraintEvaluator constraintEvaluator = new SimpleConstraintEvaluator();
ModacloudsTranslator translator = new ModacloudsTranslator(constraintEvaluator);
Agreement agreement = new Agreement();
GuaranteeTerm term = new GuaranteeTerm();
term.setKpiName("responsetime");
term.setName("rt");
term.setServiceLevel("WinVMCPUUtilization NOT_EXISTS");
agreement.setGuaranteeTerms(Arrays.asList(new IGuaranteeTerm[] { term}));
Map<IGuaranteeTerm, List<IMonitoringMetric>> map = translator.translate(agreement, json);
List<IMonitoringMetric> list = map.get(term);
if (list == null) {
assertNull(list);
}
else {
assertEquals(0, map.get(term).size());
}
}
示例4: testTranslate
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Test
public void testTranslate() throws IOException {
String json = readFile("/violation_t4c.json");
IConstraintEvaluator constraintEvaluator = new SimpleConstraintEvaluator();
Tower4CloudsTranslator translator = new Tower4CloudsTranslator(
constraintEvaluator);
Agreement agreement = new Agreement();
GuaranteeTerm term = new GuaranteeTerm();
term.setKpiName("responsetime");
term.setName("rt");
term.setServiceLevel("AverageDatabaseCPUUtilizationViolated NOT_EXISTS");
agreement.setGuaranteeTerms(Arrays
.asList(new IGuaranteeTerm[] { term }));
Map<IGuaranteeTerm, List<IMonitoringMetric>> map = translator
.translate(agreement, json);
assertEquals(1, map.get(term).size());
IMonitoringMetric item = map.get(term).get(0);
assertEquals(1435136856709L, item.getDate().getTime());
assertEquals("AverageDatabaseCPUUtilizationViolated",
item.getMetricKey());
assertEquals("0.022784559188465933e0", item.getMetricValue());
}
示例5: testTranslate2
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Test
public void testTranslate2() throws IOException {
String json = readFile("/violation_t4c_2.json");
IConstraintEvaluator constraintEvaluator = new SimpleConstraintEvaluator();
Tower4CloudsTranslator translator = new Tower4CloudsTranslator(
constraintEvaluator);
Agreement agreement = new Agreement();
GuaranteeTerm term = new GuaranteeTerm();
term.setKpiName("responsetime");
term.setName("rt");
term.setServiceLevel("ResponseTimeLogin_login_violated NOT_EXISTS");
agreement.setGuaranteeTerms(Arrays
.asList(new IGuaranteeTerm[] { term }));
Map<IGuaranteeTerm, List<IMonitoringMetric>> map = translator
.translate(agreement, json);
}
示例6: testTranslate
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Test
public void testTranslate() throws IOException {
String json = readFile("/violation_duke.json");
IConstraintEvaluator constraintEvaluator = new SimpleConstraintEvaluator();
ModacloudsTranslator translator = new ModacloudsTranslator(constraintEvaluator);
Agreement agreement = new Agreement();
GuaranteeTerm term = new GuaranteeTerm();
term.setKpiName("responsetime");
term.setName("rt");
term.setServiceLevel("ResponseTimeViolated NOT_EXISTS");
agreement.setGuaranteeTerms(Arrays.asList(new IGuaranteeTerm[] { term}));
Map<IGuaranteeTerm, List<IMonitoringMetric>> map = translator.translate(agreement, json);
assertEquals(1, map.get(term).size());
}
示例7: testTranslateWrongAgreement
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Test
public void testTranslateWrongAgreement() throws IOException {
String json = readFile("/violation_ofbiz_2.0.1.json");
IConstraintEvaluator constraintEvaluator = new SimpleConstraintEvaluator();
ModacloudsTranslator translator = new ModacloudsTranslator(constraintEvaluator);
Agreement agreement = new Agreement();
GuaranteeTerm term = new GuaranteeTerm();
term.setKpiName("responsetime");
term.setName("rt");
term.setServiceLevel("WinVMCPUUtilization NOT_EXISTS");
agreement.setGuaranteeTerms(Arrays.asList(new IGuaranteeTerm[] { term}));
Map<IGuaranteeTerm, List<IMonitoringMetric>> map = translator.translate(agreement, json);
List<IMonitoringMetric> list = map.get(term);
if (list == null) {
assertNull(list);
}
else {
assertEquals(0, map.get(term).size());
}
}
示例8: testTranslate
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Test
public void testTranslate() throws IOException {
String json = readFile("/violation_t4c.json");
IConstraintEvaluator constraintEvaluator = new SimpleConstraintEvaluator();
Tower4CloudsTranslator translator = new Tower4CloudsTranslator(constraintEvaluator);
Agreement agreement = new Agreement();
GuaranteeTerm term = new GuaranteeTerm();
term.setKpiName("responsetime");
term.setName("rt");
term.setServiceLevel("AverageDatabaseCPUUtilizationViolated NOT_EXISTS");
agreement.setGuaranteeTerms(Arrays.asList(new IGuaranteeTerm[] { term}));
Map<IGuaranteeTerm, List<IMonitoringMetric>> map = translator.translate(agreement, json);
assertEquals(1, map.get(term).size());
IMonitoringMetric item = map.get(term).get(0);
assertEquals(1435136856709L, item.getDate().getTime());
assertEquals("AverageDatabaseCPUUtilizationViolated", item.getMetricKey());
assertEquals("0.022784559188465933e0", item.getMetricValue());
}
示例9: setUp
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
now = new Date();
kpiName = "LATENCY";
constraint = kpiName + " LT 100";
contract = new Agreement();
contract.setAgreementId("agreement-test");
term = newGuaranteeTerm(kpiName, constraint);
values = new String[] { "102", "99", "99", "99", "101", "100", "99", "99" };
TestMetricsGenerator metricsGenerator = new TestMetricsGenerator(now, values);
allMetrics = metricsGenerator.getMetrics(kpiName);
IConstraintEvaluator constraintEval = new SimpleConstraintEvaluator();
evaluator = new GuaranteeTermEvaluator();
PoliciedServiceLevelEvaluator slEval =
new PoliciedServiceLevelEvaluator();
slEval.setConstraintEvaluator(constraintEval);
slEval.setBreachRepository(new DummyBreachRepository(constraint));
IBusinessValuesEvaluator bEval = new DummyBusinessValuesEvaluator();
evaluator.setServiceLevelEvaluator(slEval);
evaluator.setBusinessEvaluator(bEval);
}
示例10: setUp
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
now = new Date();
kpiName = "LATENCY";
constraint = kpiName + " LT " + THRESHOLD; /* Must agree with isBreach() */
IConstraintEvaluator metricsValidator = new SimpleConstraintEvaluator();
evaluator = new PoliciedServiceLevelEvaluator();
evaluator.setConstraintEvaluator(metricsValidator);
contract = new Agreement();
contract.setAgreementId("agreement-test");
term = newGuaranteeTerm(kpiName, constraint);
}
示例11: setUp
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
now = new Date();
kpiName = "LATENCY";
constraint = kpiName + " LT " + THRESHOLD; /* Must agree with isBreach() */
IConstraintEvaluator metricsValidator = new SimpleConstraintEvaluator();
evaluator = new PoliciedServiceLevelEvaluator();
evaluator.setConstraintEvaluator(metricsValidator);
contract = new Agreement();
contract.setAgreementId("agreement-test");
term = newGuaranteeTerm(kpiName, constraint);
}
示例12: SimpleMetricsTranslator
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
public SimpleMetricsTranslator(IConstraintEvaluator constraintEvaluator) {
this.constraintEvaluator = constraintEvaluator;
logger.debug("Created SimpleMetricsTranslator");
}
示例13: getConstraintEvaluator
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
public IConstraintEvaluator getConstraintEvaluator() {
return constraintEval;
}
示例14: setConstraintEvaluator
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
public void setConstraintEvaluator(IConstraintEvaluator constraintEval) {
this.constraintEval = constraintEval;
}
示例15: ModacloudsTranslator
import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
public ModacloudsTranslator(IConstraintEvaluator constraintEvaluator) {
this.constraintEvaluator = constraintEvaluator;
}