Package org.radargun.config

Examples of org.radargun.config.MasterConfig


      out("Configuration file is: " + config);

      try {
         ConfigParser configParser = ConfigParser.getConfigParser();
         MasterConfig masterConfig = configParser.parseConfig(config);
         Master master = new Master(masterConfig);
         master.run();
      } catch (Exception e) {
         log.error("Master failed", e);
         e.printStackTrace();
View Full Code Here


      String targetDir = args[1];
      for (int i = 2; i < args.length; ++i) {
         ReporterHelper.registerReporters(args[i]);
      }

      MasterConfig config;
      try {
         config = DomConfigParser.getConfigParser().parseConfig(benchmark);
      } catch (Exception e) {
         System.err.println("Failed to parse " + benchmark);
         e.printStackTrace();
         return;
      }

      List<Report> reports = new ArrayList<>();
      for (File reportFile : new File(targetDir).listFiles()) {
         FileInputStream fileInputStream = null;
         ObjectInputStream objectInputStream = null;
         try {
            fileInputStream = new FileInputStream(reportFile);
            objectInputStream = new ObjectInputStream(fileInputStream);
            Object obj = objectInputStream.readObject();
            if (obj instanceof Report) {
               reports.add((Report) obj);
            } else {
               System.err.println(obj + " is not a report");
            }
         } catch (IOException e) {
            System.err.println("Failed to read " + reportFile);
            e.printStackTrace();
         } catch (ClassNotFoundException e) {
            System.err.println("Failed to load class from " + reportFile);
            e.printStackTrace();
         } finally {
            Utils.close(fileInputStream, objectInputStream);
         }
      }

      for (ReporterConfiguration rc : config.getReporters()) {
         for (ReporterConfiguration.Report rcr : rc.getReports()) {
            try {
               Reporter reporter = ReporterHelper.createReporter(rc.type, rcr.getProperties());
               if (reporter instanceof SerializedReporter) continue;
               reporter.run(reports);
View Full Code Here

TOP

Related Classes of org.radargun.config.MasterConfig

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.