Package org.radargun.reporting

Examples of org.radargun.reporting.Timeline


               if (threads[i] != null) {
                  stats.add(threads[i].getStatsSnapshot(true));
               }
            }
         }
         Timeline timeline = slaveState.getTimeline();
         long now = System.currentTimeMillis();
         long cacheSize = sizeThread.getAndResetSize();
         timeline.addValue(CACHE_SIZE, new Timeline.Value(now, cacheSize));
         if (stats.isEmpty()) {
            // add zero for all operations we've already reported
            for (String valueCategory : timeline.getValueCategories()) {
               if (valueCategory.endsWith(" Throughput")) {
                  timeline.addValue(valueCategory, new Timeline.Value(now, 0));
               }
            }
         } else {
            Statistics aggregated = stats.get(0).copy();
            for (int i = 1; i < stats.size(); ++i) {
               aggregated.merge(stats.get(i));
            }
            for (Map.Entry<String, OperationStats> entry : aggregated.getOperationsStats().entrySet()) {
               Throughput throughput = entry.getValue().getRepresentation(Throughput.class, stats.size(), TimeUnit.MILLISECONDS.toNanos(aggregated.getEnd() - aggregated.getBegin()));
               if (throughput != null && (throughput.actual != 0 || timeline.getValues(entry.getKey() + " Throughput") != null)) {
                  timeline.addValue(entry.getKey() + " Throughput", new Timeline.Value(now, throughput.actual));
               }
            }
         }

         log.trace("Adding iteration " + BackgroundOpsManager.this.stats.size() + ": " + stats);
View Full Code Here


      slaveState.setService(service);
      slaveState.setConfigName(configuration.name);
      this.service = ServiceHelper.createService(slaveState.getClassLoader(), plugin, service, configuration.name, setups.get(0).file, 0, setups.get(0).getProperties(), extras);
      this.traits = TraitHelper.retrieve(this.service);
      slaveState.setTraits(traits);
      slaveState.setTimeline(new Timeline(0));
   }
View Full Code Here

public class TimelineChartsTest {

   @Test
   public void test() {
      long now = System.currentTimeMillis();
      Timeline t0 = new Timeline(0);
      Timeline t1 = new Timeline(1);
      t0.addValue("Category A", new Timeline.Value(now + 1000, 10));
      t0.addValue("Category A", new Timeline.Value(now + 2000, 5));
      t0.addValue("Category A", new Timeline.Value(now + 3000, 8));
      t0.addValue("Category A", new Timeline.Value(now + 4000, 12));

      t1.addValue("Category A", new Timeline.Value(now + 1000, 13));
      t1.addValue("Category A", new Timeline.Value(now + 2000, 15));
      t1.addValue("Category A", new Timeline.Value(now + 4000, 5));

      t0.addEvent("Category B", new Timeline.TextEvent(now + 800, "Started"));
      t0.addEvent("Category B", new Timeline.IntervalEvent(now + 1500, "Stage one", 1000));
      t0.addEvent("Category B", new Timeline.IntervalEvent(now + 2600, "Stage two", 1500));

      t1.addEvent("Category B", new Timeline.TextEvent(now + 900, "Started"));
      t1.addEvent("Category B", new Timeline.IntervalEvent(now + 1400, "Stage one", 1100));
      t1.addEvent("Category B", new Timeline.IntervalEvent(now + 2700, "Stage two", 1600));

      t0.addValue("Category C", new Timeline.Value(now + 1000, 600));
      t0.addValue("Category C", new Timeline.Value(now + 2500, 800));
      t0.addValue("Category C", new Timeline.Value(now + 3100, 2000));
      t0.addValue("Category C", new Timeline.Value(now + 4000, 1200));

      t1.addValue("Category C", new Timeline.Value(now + 1200, 513));
      t1.addValue("Category C", new Timeline.Value(now + 2100, 912));
      t1.addValue("Category C", new Timeline.Value(now + 3800, 485));

      Cluster cluster = new Cluster();
      cluster.addGroup("default", 2);
      TimelineDocument doc = new TimelineDocument(new TimelineDocument.Configuration(), "test", "testconfig", "Test Config", Arrays.asList(t0, t1), cluster);
      try {
View Full Code Here

      Cluster.Group group = cluster.getGroup(state.getSlaveIndex());
      Configuration.Setup setup = configuration.getSetup(group.name);
      state.setCluster(cluster);
      state.setPlugin(setup.plugin);
      state.setService(setup.service);
      state.setTimeline(new Timeline(slaveIndex));
      Map<String, String> extras = getCurrentExtras(configuration, cluster);
      Object service = ServiceHelper.createService(state.getClassLoader(), setup.plugin, setup.service, configuration.name, setup.file, slaveIndex, setup.getProperties(), extras);
      log.info("Service is " + service.getClass().getSimpleName() + PropertyHelper.toString(service));
      Map<Class<?>, Object> traits = TraitHelper.retrieve(service);
      state.setTraits(traits);
View Full Code Here

TOP

Related Classes of org.radargun.reporting.Timeline

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.