当前位置: 首页>>代码示例>>Java>>正文


Java IConstraintEvaluator类代码示例

本文整理汇总了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);
	
}
 
开发者ID:Atos-FiwareOps,项目名称:sla-framework,代码行数:27,代码来源:GuaranteeTermEvaluatorTest.java

示例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());
}
 
开发者ID:modaclouds,项目名称:modaclouds-sla-core,代码行数:18,代码来源:ModacloudsTranslatorTest.java

示例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());
	}
}
 
开发者ID:modaclouds,项目名称:modaclouds-sla-core,代码行数:24,代码来源:ModacloudsTranslatorTest.java

示例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());
}
 
开发者ID:modaclouds,项目名称:modaclouds-sla-core,代码行数:26,代码来源:Tower4CloudsTranslatorTest.java

示例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);
}
 
开发者ID:modaclouds,项目名称:modaclouds-sla-core,代码行数:19,代码来源:Tower4CloudsTranslatorTest.java

示例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());
}
 
开发者ID:SeaCloudsEU,项目名称:SeaCloudsPlatform,代码行数:18,代码来源:ModacloudsTranslatorTest.java

示例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());
    }
}
 
开发者ID:SeaCloudsEU,项目名称:SeaCloudsPlatform,代码行数:24,代码来源:ModacloudsTranslatorTest.java

示例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());
}
 
开发者ID:SeaCloudsEU,项目名称:SeaCloudsPlatform,代码行数:22,代码来源:Tower4CloudsTranslatorTest.java

示例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);
    
}
 
开发者ID:SeaCloudsEU,项目名称:SeaCloudsPlatform,代码行数:27,代码来源:GuaranteeTermEvaluatorTest.java

示例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);
}
 
开发者ID:Atos-FiwareOps,项目名称:sla-framework,代码行数:15,代码来源:PoliciedServiceLevelEvaluatorTest.java

示例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);
}
 
开发者ID:SeaCloudsEU,项目名称:SeaCloudsPlatform,代码行数:15,代码来源:PoliciedServiceLevelEvaluatorTest.java

示例12: SimpleMetricsTranslator

import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
public SimpleMetricsTranslator(IConstraintEvaluator constraintEvaluator) {
	this.constraintEvaluator = constraintEvaluator;
	logger.debug("Created SimpleMetricsTranslator");
}
 
开发者ID:Atos-FiwareOps,项目名称:sla-framework,代码行数:5,代码来源:SimpleMetricsTranslator.java

示例13: getConstraintEvaluator

import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
public IConstraintEvaluator getConstraintEvaluator() {
	return constraintEval;
}
 
开发者ID:Atos-FiwareOps,项目名称:sla-framework,代码行数:4,代码来源:PoliciedServiceLevelEvaluator.java

示例14: setConstraintEvaluator

import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
public void setConstraintEvaluator(IConstraintEvaluator constraintEval) {
	this.constraintEval = constraintEval;
}
 
开发者ID:Atos-FiwareOps,项目名称:sla-framework,代码行数:4,代码来源:PoliciedServiceLevelEvaluator.java

示例15: ModacloudsTranslator

import eu.atos.sla.evaluation.constraint.IConstraintEvaluator; //导入依赖的package包/类
public ModacloudsTranslator(IConstraintEvaluator constraintEvaluator) {
	this.constraintEvaluator = constraintEvaluator;
}
 
开发者ID:modaclouds,项目名称:modaclouds-sla-core,代码行数:4,代码来源:ModacloudsTranslator.java


注:本文中的eu.atos.sla.evaluation.constraint.IConstraintEvaluator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。