Package net.sourceforge.stat4j.config

Examples of net.sourceforge.stat4j.config.StatisticsFactory


    // load factory
    String factoryName = Util.getValue("factory.name");
    String prefix = "factory." + factoryName + ".";
    String className = Util.getValue(prefix + "classname");

    StatisticsFactory factory =
      (StatisticsFactory) Util.createObject(className);
    Properties p = Util.createProperties(prefix);
    factory.init(p);

    // load stats to collect/calculate
    Statistic[] stats = factory.loadStatistics();
   
    // load alerts
    Alert[] alerts = factory.loadAlerts();
   
    for (int i = 0; i < alerts.length; ++i) {
      Alert a = alerts[i];

      this.alerts.put(a.getStatisticName(), a);
    }
   

    HashMap filterMap = new HashMap();

    // Map statistics
    for (int i = 0; i < stats.length; ++i) {
      Statistic s = stats[i];

      statistics.put(s.getName(), s);

      Calculator c = factory.createCalculator(s.getCalculator(), s);
      calculators.put(s.getName(), c);

      // Map filters by regexpression
      // to ensure we only match on a given
      // expression once
View Full Code Here

TOP

Related Classes of net.sourceforge.stat4j.config.StatisticsFactory

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.