Examples of alertHistory()


Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

    _setupTool.getClusterManagementTool().setConfig(scope, properties);

    task.aggregate();
    Thread.sleep(100);

    history = manager.getHelixDataAccessor().getProperty(keyBuilder.alertHistory());
    //
    Assert.assertNotNull(history);
    Assert.assertEquals(history.getRecord().getMapFields().size(), 1);
  }
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

    _setupTool.getClusterManagementTool().addAlert(CLUSTER_NAME, _alertStr2);

    int historySize = 0;
    HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();
    Builder keyBuilder = helixDataAccessor.keyBuilder();
    HelixProperty property = helixDataAccessor.getProperty(keyBuilder.alertHistory());
    ZNRecord history = null;
    if (property != null) {
      history = property.getRecord();
      historySize = property.getRecord().getMapFields().size();
    }
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

    HealthStatsAggregator task = new HealthStatsAggregator(_controller);

    task.aggregate();
    Thread.sleep(100);

    history = helixDataAccessor.getProperty(keyBuilder.alertHistory()).getRecord();
    //
    Assert.assertEquals(history.getMapFields().size(), 1 + historySize);
    TreeMap<String, Map<String, String>> recordMap = new TreeMap<String, Map<String, String>>();
    recordMap.putAll(history.getMapFields());
    Map<String, String> lastRecord = recordMap.firstEntry().getValue();
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

        .equals("ON"));

    setHealthData(metrics1, metrics2);
    task.aggregate();
    Thread.sleep(100);
    history = helixDataAccessor.getProperty(keyBuilder.alertHistory()).getRecord();
    // no change
    Assert.assertEquals(history.getMapFields().size(), 1 + historySize);
    recordMap = new TreeMap<String, Map<String, String>>();
    recordMap.putAll(history.getMapFields());
    lastRecord = recordMap.firstEntry().getValue();
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

        122, 115, 222, 41, 16
    };
    setHealthData(metrics3, metrics4);
    task.aggregate();
    Thread.sleep(100);
    history = helixDataAccessor.getProperty(keyBuilder.alertHistory()).getRecord();
    // new delta should be recorded
    Assert.assertEquals(history.getMapFields().size(), 2 + historySize);
    recordMap = new TreeMap<String, Map<String, String>>();
    recordMap.putAll(history.getMapFields());
    lastRecord = recordMap.lastEntry().getValue();
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

    setHealthData(metrics5, metrics6);
    task.aggregate();

    for (int i = 0; i < 10; i++) {
      Thread.sleep(500);
      history = helixDataAccessor.getProperty(keyBuilder.alertHistory()).getRecord();
      recordMap = new TreeMap<String, Map<String, String>>();
      recordMap.putAll(history.getMapFields());
      lastRecord = recordMap.lastEntry().getValue();

      if (history.getMapFields().size() == 3 + historySize && lastRecord.size() == 6) {
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

      };

      setHealthData(metricsx, metricsy);
      task.aggregate();
      Thread.sleep(100);
      history = helixDataAccessor.getProperty(keyBuilder.alertHistory()).getRecord();

      Assert.assertEquals(history.getMapFields().size(), Math.min(3 + i + 1 + historySize, 30));
      recordMap = new TreeMap<String, Map<String, String>>();
      recordMap.putAll(history.getMapFields());
      lastRecord = recordMap.lastEntry().getValue();
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

      setHealthData(metricsx, metricsy);
      task.aggregate();
      for (int j = 0; j < 10; j++) {
        Thread.sleep(100);
        history = helixDataAccessor.getProperty(keyBuilder.alertHistory()).getRecord();
        recordMap = new TreeMap<String, Map<String, String>>();
        recordMap.putAll(history.getMapFields());
        lastRecord = recordMap.lastEntry().getValue();

        if (history.getMapFields().size() == 30 && lastRecord.size() == 10)
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

    boolean fired = Boolean.parseBoolean(alertStatusMap.get(AlertValueAndStatus.FIRED_NAME));
    Assert.assertEquals(Double.parseDouble(val), Double.parseDouble("15.1"));
    Assert.assertTrue(fired);

    // Verify Alert history from ZK
    ZNRecord alertHistory = accessor.getProperty(keyBuilder.alertHistory()).getRecord();

    String deltakey = (String) (alertHistory.getMapFields().keySet().toArray()[0]);
    Map<String, String> delta = alertHistory.getMapField(deltakey);
    Assert.assertTrue(delta.size() == 1);
    Assert
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.alertHistory()

      String val = alertStatusMap.get(AlertValueAndStatus.VALUE_NAME);
      boolean fired = Boolean.parseBoolean(alertStatusMap.get(AlertValueAndStatus.FIRED_NAME));
      Assert.assertEquals(Double.parseDouble(val), (double) i * 5 + 0.1);
      Assert.assertTrue(fired);
    }
    ZNRecord alertHistory = accessor.getProperty(keyBuilder.alertHistory()).getRecord();

    String deltakey = (String) (alertHistory.getMapFields().keySet().toArray()[0]);
    Map<String, String> delta = alertHistory.getMapField(deltakey);
    Assert.assertEquals(delta.size(), 3);
    for (int i = 2; i < 5; i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.