Package org.radargun.stats

Examples of org.radargun.stats.OperationStats


   public boolean isSuspect(int node, String operation) {
      Statistics ns;
      if (node >= nodeStats.size() || (ns = nodeStats.get(node)) == null) {
         return false;
      }
      OperationStats nos = ns.getOperationsStats().get(operation);
      OperationStats tos = totalStats.getOperationsStats().get(operation);
      if (nos == null) {
         return tos != null;
      }
      DefaultOutcome ndo = nos.getRepresentation(DefaultOutcome.class);
      DefaultOutcome tdo = tos.getRepresentation(DefaultOutcome.class);
      if (ndo == null) {
         return tdo != null;
      }
      double requestsAverage = getRequestsAverage(operation);
      return ndo.requests < requestsAverage * 4 / 5 || requestsAverage > tdo.requests * 5 / 4;
View Full Code Here


   private double getRequestsAverage(String operation) {
      long requests = 0;
      int slaveStatsCount = 0;
      for (Statistics ns : nodeStats) {
         if (ns == null) continue;
         OperationStats operationStats = ns.getOperationsStats().get(operation);
         if (operationStats != null) {
            DefaultOutcome defaultOutcome = operationStats.getRepresentation(DefaultOutcome.class);
            if (defaultOutcome != null) {
               requests += defaultOutcome.requests;
               slaveStatsCount++;
            }
         }
View Full Code Here

   }

   protected void addToChart(ComparisonChart chart, String subCategory, String operation, StatisticType statisticType, Map<Report, List<Aggregation>> reportAggregationMap) {
      for (Map.Entry<Report, List<Aggregation>> entry : reportAggregationMap.entrySet()) {
         for (Aggregation aggregation : entry.getValue()) {
            OperationStats operationStats = aggregation.totalStats.getOperationsStats().get(operation);
            if (operationStats == null) continue;

            String categoryName = entry.getKey().getConfiguration().name;
            if (subCategory != null)
               categoryName = String.format("%s, %s", categoryName, subCategory);

            double subCategoryNumeric;
            String subCategoryValue;
            if (maxIterations > 1) {
               subCategoryNumeric = aggregation.iteration.id;
               subCategoryValue = aggregation.iteration.getValue() != null ? aggregation.iteration.getValue() : String.valueOf(aggregation.iteration.id);
            } else {
               subCategoryNumeric = entry.getKey().getCluster().getSize();
               subCategoryValue = String.format("Size %.0f", subCategoryNumeric);
            }
            switch (statisticType) {
               case MEAN_AND_DEV: {
                  MeanAndDev meanAndDev = operationStats.getRepresentation(MeanAndDev.class);
                  if (meanAndDev == null) continue;
                  chart.addValue(toMillis(meanAndDev.mean), toMillis(meanAndDev.dev), categoryName, subCategoryNumeric, subCategoryValue);
                  break;
               }
               case ACTUAL_THROUGHPUT: {
                  Throughput throughput = operationStats.getRepresentation(Throughput.class,
                        aggregation.totalThreads, aggregation.totalStats.getEnd() - aggregation.totalStats.getBegin());
                  if (throughput == null) continue;
                  chart.addValue(toMillis(throughput.actual), 0, categoryName, subCategoryNumeric, subCategoryValue);
               }
            }
View Full Code Here

      write(String.format("\">%s</th><th>%s</th>", report.getConfiguration().name, report.getCluster()));

      int iteration = 0;
      for (Aggregation aggregation : aggregations) {
         Statistics statistics = aggregation.totalStats;
         OperationStats operationStats = statistics == null ? null : statistics.getOperationsStats().get(operation);
         long period = TimeUnit.MILLISECONDS.toNanos(statistics.getEnd() - statistics.getBegin());
         writeRepresentations(operationStats, operation, report.getCluster().getClusterIndex(), iteration, "total",
                              aggregation.totalThreads, period, hasPercentiles, hasHistograms, false, aggregation.anySuspect(operation));
         ++iteration;
      }

      write("</tr>\n");
      for (int node = 0; node < nodeCount; ++node) {
         write(String.format("<tr id=\"e%d\" style=\"visibility: collapse;\"><th colspan=\"2\" style=\"text-align: right\">node%d</th>", elementCounter++, node));
         for (Aggregation aggregation : aggregations) {
            Statistics statistics = node >= aggregation.nodeStats.size() ? null : aggregation.nodeStats.get(node);

            OperationStats operationStats = null;
            long period = 0;
            if (statistics != null) {
               operationStats = statistics.getOperationsStats().get(operation);
               period = TimeUnit.MILLISECONDS.toNanos(statistics.getEnd() - statistics.getBegin());
            }
View Full Code Here

         @Override
         public boolean accept(List<Aggregation> aggregations) {
            return Projections.any(Projections.notNull(aggregations), new Projections.Condition<Aggregation>() {
               @Override
               public boolean accept(Aggregation aggregation) {
                  OperationStats operationStats = aggregation.totalStats.getOperationsStats().get(operation);
                  return operationStats != null && operationStats.getRepresentation(representationClass, representationArgs) != null;
               }
            });
         }
      });
   }
View Full Code Here

         if (below == null && over == null) throw new IllegalStateException("Must define either 'below' or 'over'!");
      }

      @Override
      public boolean evaluate(int threads, Statistics statistics) {
         OperationStats stats = statistics.getOperationsStats().get(on);
         if (stats == null) throw new IllegalStateException("No statistics for operation " + on);
         DefaultOutcome outcome = stats.getRepresentation(DefaultOutcome.class);
         if (outcome == null) throw new IllegalStateException("Cannot determine mean from " + stats);
         log.info("Mean is " + Utils.prettyPrintTime((long) outcome.responseTimeMean, TimeUnit.NANOSECONDS) + PropertyHelper.toString(this));
         if (below != null) return outcome.responseTimeMean < below;
         if (over != null) return outcome.responseTimeMean > over;
         throw new IllegalStateException();
View Full Code Here

         if (below == null && over == null) throw new IllegalStateException("Must define either 'below' or 'over'!");
      }

      @Override
      public boolean evaluate(int threads, Statistics statistics) {
         OperationStats stats = statistics.getOperationsStats().get(on);
         if (stats == null) throw new IllegalStateException("No statistics for operation " + on);
         org.radargun.stats.representation.Throughput throughput = stats.getRepresentation(
               org.radargun.stats.representation.Throughput.class, threads,
               TimeUnit.MILLISECONDS.toNanos(statistics.getEnd() - statistics.getBegin()));
         if (throughput == null) throw new IllegalStateException("Cannot determine throughput from " + stats);
         log.info("Throughput is " + throughput.actual + " ops/s " + PropertyHelper.toString(this));
         if (below != null) return throughput.actual < below;
View Full Code Here

         if (below == null && over == null) throw new IllegalStateException("Must define either 'below' or 'over'!");
      }

      @Override
      public boolean evaluate(int threads, Statistics statistics) {
         OperationStats stats = statistics.getOperationsStats().get(on);
         if (stats == null) throw new IllegalStateException("No statistics for operation " + on);
         DefaultOutcome outcome = stats.getRepresentation(DefaultOutcome.class);
         if (outcome == null) throw new IllegalStateException("Cannot determine request count from " + stats);
         log.info("Executed " + outcome.requests + " reqs " + PropertyHelper.toString(this));
         if (below != null) return outcome.requests < below;
         if (over != null) return outcome.requests > over;
         throw new IllegalStateException();
View Full Code Here

         if (defs != 1) throw new IllegalStateException("Must define exactly one of 'total-below', 'total-over', 'percent-below', 'percent-over'");
      }

      @Override
      public boolean evaluate(int threads, Statistics statistics) {
         OperationStats stats = statistics.getOperationsStats().get(on);
         if (stats == null) throw new IllegalStateException("No statistics for operation " + on);
         DefaultOutcome outcome = stats.getRepresentation(DefaultOutcome.class);
         if (outcome == null) throw new IllegalStateException("Cannot determine error count from " + stats);
         log.info("Encountered " + outcome.errors + " errors " + PropertyHelper.toString(this));
         if (totalBelow != null) return outcome.errors < totalBelow;
         if (totalOver != null) return outcome.errors > totalOver;
         if (percentBelow != null) return outcome.errors * 100 < outcome.requests * percentBelow;
 
View Full Code Here

         if (below == null && over == null) throw new IllegalStateException("Must define either 'below' or 'over'!");
      }

      @Override
      public boolean evaluate(int threads, Statistics statistics) {
         OperationStats stats = statistics.getOperationsStats().get(on);
         if (stats == null) throw new IllegalStateException("No statistics for operation " + on);
         org.radargun.stats.representation.Percentile percentile
               = stats.getRepresentation(org.radargun.stats.representation.Percentile.class, value);
         if (percentile == null) throw new IllegalStateException("Cannot determine percentile from " + stats);
         log.info("Response time is " + Utils.prettyPrintTime((long) percentile.responseTimeMax, TimeUnit.NANOSECONDS) + PropertyHelper.toString(this));
         if (below != null) return percentile.responseTimeMax < below;
         if (over != null) return percentile.responseTimeMax > over;
         throw new IllegalStateException();
View Full Code Here

TOP

Related Classes of org.radargun.stats.OperationStats

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.