Package com.dianping.cat.report.task.alert

Examples of com.dianping.cat.report.task.alert.AlertResultEntity


  }

  @Test
  public void testCondition() {
    Map<String, List<Condition>> conditionsMap = buildConfigMap(buildMonitorRuleFromFile("/config/demo-rule-monitor.xml"));
    AlertResultEntity result;

    Assert.assertNotNull(conditionsMap);

    double[] baseline7 = { 200, 200 };
    double[] value7 = { 100, 100 };
    result = extractError(m_check.checkData(value7, baseline7, conditionsMap.get("conditionCombination")));
    Assert.assertEquals(result.isTriggered(), true);

    double[] baseline8 = { 200, 200 };
    double[] value8 = { 100, 100 };
    result = extractError(m_check.checkData(value8, baseline8, conditionsMap.get("subconditionCombination")));
    Assert.assertNull(result);
View Full Code Here


    Assert.assertNotNull(configMap);

    double baseline[] = { 50, 200, 200 };
    double value[] = { 50, 100, 100 };
    AlertResultEntity result = extractError(m_check.checkData(value, baseline, configMap.get("two-minute")));
    Assert.assertEquals(result.isTriggered(), true);
  }
View Full Code Here

    Assert.assertNotNull(configMap);

    double baseline[] = { 200, 350 };
    double value[] = { 100, 50 };
    AlertResultEntity result = extractError(m_check.checkData(value, baseline, configMap.get("demo1")));
    Assert.assertEquals(result.isTriggered(), true);
  }
View Full Code Here

    Assert.assertNotNull(configMap);

    double baseline[] = { 50, 200, 200 };
    double value[] = { 50, 100, 100 };
    AlertResultEntity result = extractError(m_checker.checkData(value, baseline,
          buildConditions(configMap.get("two-minute"))));
    Assert.assertEquals(result.isTriggered(), true);
  }
View Full Code Here

    Assert.assertNotNull(configMap);

    double baseline[] = { 200, 200 };
    double value[] = { 100, 100 };
    AlertResultEntity result = extractError(m_checker.checkData(value, baseline,
          buildConditions(configMap.get("decreasePercentage"))));
    Assert.assertEquals(result.isTriggered(), true);

    double[] baseline2 = { 200, 300 };
    double[] value2 = { 100, 100 };
    result = extractError(m_checker.checkData(value2, baseline2, buildConditions(configMap.get("decreaseValue"))));
    Assert.assertEquals(result.isTriggered(), true);

    double[] baseline3 = { 200, 50 };
    double[] value3 = { 400, 100 };
    result = extractError(m_checker
          .checkData(value3, baseline3, buildConditions(configMap.get("increasePercentage"))));
    Assert.assertEquals(result.isTriggered(), true);

    double[] baseline4 = { 200, 50 };
    double[] value4 = { 400, 100 };
    result = extractError(m_checker.checkData(value4, baseline4, buildConditions(configMap.get("increaseValue"))));
    Assert.assertEquals(result.isTriggered(), true);

    double[] baseline5 = { 200, 200 };
    double[] value5 = { 500, 600 };
    result = extractError(m_checker.checkData(value5, baseline5, buildConditions(configMap.get("absoluteMaxValue"))));
    Assert.assertEquals(result.isTriggered(), true);

    double[] baseline6 = { 200, 200 };
    double[] value6 = { 50, 40 };
    result = extractError(m_checker.checkData(value6, baseline6, buildConditions(configMap.get("absoluteMinValue"))));
    Assert.assertEquals(result.isTriggered(), true);

    double[] baseline7 = { 200, 200 };
    double[] value7 = { 100, 100 };
    result = extractError(m_checker.checkData(value7, baseline7,
          buildConditions(configMap.get("conditionCombination"))));
    Assert.assertEquals(result.isTriggered(), true);

    double[] baseline8 = { 200, 200 };
    double[] value8 = { 100, 100 };
    result = extractError(m_checker.checkData(value8, baseline8,
          buildConditions(configMap.get("subconditionCombination"))));
View Full Code Here

TOP

Related Classes of com.dianping.cat.report.task.alert.AlertResultEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.