Examples of Measurement


Examples of algorithm.Measurement

        @Test
        public void AveragingAggregagtor_Produces_Average() {
    PointsAggregator aggregator = new PointsAggregator(measurements, new EmptyFilter(), new AveragingStrategy());

    Measurement result = aggregator.aggregate();

    assertEquals(35, result.getX());
    assertEquals(10, result.getY());
        }
View Full Code Here

Examples of algorithm.Measurement

        @Test
        public void LowPassAveragingAggregator_Applys_Filter() {
    PointsAggregator aggregator = new PointsAggregator(measurements, new LowPassFilter(), new AveragingStrategy());

    Measurement result = aggregator.aggregate();

    assertEquals(3, result.getX());
    assertEquals(12, result.getY());
        }
View Full Code Here

Examples of com.google.caliper.Measurement

        if (rateValue == 1.0 && timeValue == 1.0 && sizeValue == 1.0) {
            /** ignore complete blank entries */
            return;
        }

        final Measurement markRate = new Measurement(RATE_UNIT, rateValue,
                rateValue);
        rateMap.put(System.nanoTime(), markRate);

        final Measurement markTime = new Measurement(TIME_UNIT, timeValue,
                timeValue);
        timeMap.put(System.nanoTime(), markTime);

        final Measurement markSize = new Measurement(SIZE_UNIT, sizeValue,
                sizeValue);
        sizeMap.put(System.nanoTime(), markSize);
    }
View Full Code Here

Examples of com.google.caliper.model.Measurement

    }
  }
 
  @Override public Iterable<Measurement> measure() throws Exception {
    long nanos = invokeTimeMethod(nextReps);
    Measurement measurement = new Measurement.Builder()
        .description("runtime")
        .value(Value.create(nanos, "ns"))
        .weight(nextReps)
        .build();
   
View Full Code Here

Examples of com.google.caliper.model.Measurement

  public void testSuccess() throws Exception {
    runner.forBenchmark(TestBenchmark.class)
        .instrument("arbitrary")
        .run();
    Measurement measurement = Iterables.getOnlyElement(
        Iterables.getOnlyElement(runner.trials()).measurements());
    Measurement expected = new Measurement.Builder()
        .description("fake measurment")
        .weight(1)
        .value(Value.create(1.0, "hz"))
        .build();
    assertEquals(expected, measurement);
View Full Code Here

Examples of com.google.caliper.model.Measurement

                log.notifyMeasurementStarting();
                final int reps = 5;
                final long nanos = invokeLatencyMethod(reps);

                final Measurement measure = new Measurement();
                measure.value = (double) nanos;
                measure.weight = (double) (reps * repeatFactor);
                measure.unit = "ns";
                measure.description = "propagation latency";
                final double nanosPerRep = measure.value / measure.weight;
View Full Code Here

Examples of com.google.caliper.model.Measurement

                long nanos = invokeTimeMethod(reps);
                double nanos_per_rep = nanos / reps;
                double seconds = (double) nanos_per_rep / 1000000000;
                double messages_per_second = totalMessages / seconds;

                Measurement m = new Measurement();
                m.value = messages_per_second;
                m.weight = 1;
                m.unit = "Messages per Second";
                m.description = "";
                double nanosPerRep = m.value / m.weight;
View Full Code Here

Examples of com.google.caliper.model.Measurement

            values = getValues(modelResult.measurements);
            min = Doubles.min(values);
            max = Doubles.max(values);
            median = computeMedian(values);
            mean = computeMean(values);
            final Measurement firstMeasurement = modelResult.measurements.get(0);
            responseUnit = firstMeasurement.unit;
            responseDesc = firstMeasurement.description;
        }
View Full Code Here

Examples of com.swinarta.sunflower.core.model.Measurement

     
      Selling s = coreManager.get(Selling.class, id);
      s.setSellingPrice(sellingPrice);
     
      if(measurementSelectionId.intValue() != s.getMeasurement().getId().intValue()){
        Measurement selm = coreManager.get(Measurement.class, measurementSelectionId);
        s.setMeasurement(selm);
      }
     
      try{
        respSelling = coreManager.save(Selling.class, s);
      }catch (Exception e) {
        SgwtRestErrorResponse resp = new SgwtRestErrorResponse(SgwtRestResponseBase.RESPONSE_FAILURE);
        resp.addError("exception", e.getMessage());
        return resp;
      }
     
    }else if(request.getOperationType() == OPERATION_TYPE.ADD){
                 
      Double sellingPrice = RequestUtil.getDouble(request.getData().get("sellingPrice"));
      Integer measurementSelectionId = RequestUtil.getInteger(request.getData().get("measurementSelectionId"));
     
      Selling s = new Selling();
      s.setSellingPrice(sellingPrice);
     
      Measurement selm = coreManager.get(Measurement.class, measurementSelectionId);
      s.setMeasurement(selm);
     
      Product prod = coreManager.get(Product.class, id);
      s.setProduct(prod);
   
View Full Code Here

Examples of eu.planets_project.pp.plato.model.measurement.Measurement

                        settings);
        // provide a nice name for the resulting object
        setResultName(result, sampleObject);
        long duration = (System.nanoTime()-start)/(1000000);
        service.addExperience(result.getFeedbackKey(), action.getUrl(),
                new Measurement("roundtripTimeMS",new Double(duration)));
        return result;
    }
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.