Java Code Examples for org.openjdk.jmh.annotations.OutputTimeUnit

The following are top voted examples for showing how to use org.openjdk.jmh.annotations.OutputTimeUnit. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: direwolves   File: ValidationBenchmarks.java   View source code 6 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Fork(1)
@OperationsPerInvocation(10000)
public void testApi() {
  Map<String, Object> data = new HashMap<String, Object>();
  data.put("encryptKey", "0000000000000000");
  data.put("barcode", "LH10312ACCF23C4F3A5");

  Multimap<String, Rule> rules = ArrayListMultimap.create();

  rules.put("barcode", Rule.required());
  rules.put("barcode", Rule.regex("[0-9A-F]{16}"));
  rules.put("encryptKey", Rule.required());
  rules.put("encryptKey", Rule.regex("LH[0-7][0-9a-fA-F]{2}[0-5][0-4][0-9a-fA-F]{12}"));
  try {
    Validations.validate(data, rules);
  } catch (Exception e) {
  }

}
 
Example 2
Project: direwolves   File: ValidationBenchmarks.java   View source code 6 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Fork(1)
@OperationsPerInvocation(10000)
public void testAverage() {
  Map<String, Object> data = new HashMap<String, Object>();
  data.put("encryptKey", "0000000000000000");
  data.put("barcode", "LH10312ACCF23C4F3A5");

  Multimap<String, Rule> rules = ArrayListMultimap.create();

  rules.put("barcode", Rule.required());
  rules.put("barcode", Rule.regex("[0-9A-F]{16}"));
  rules.put("encryptKey", Rule.required());
  rules.put("encryptKey", Rule.regex("LH[0-7][0-9a-fA-F]{2}[0-5][0-4][0-9a-fA-F]{12}"));
  try {
    Validations.validate(data, rules);
  } catch (Exception e) {
  }
}
 
Example 3
Project: deltaforce   File: ClientOrderBenchmark.java   View source code 6 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void latency() throws InvalidObjectException {
    ClientOrderBuilder order = new ClientOrderBuilder();
    order.setClientId(1234);
    order.setAssignee("ALGO");
    order.setBoardCode("MAIN");
    order.setCurrencyCode("HKD");
    order.setQuantity(1000);
    order.setId(123456789);
    order.setPrice(3.0);
    order.setCreatedBy("CREATEDBY");
    order.setUpdatedBy("UPDATEDBY");
    order.setExchangeCode("1234");
    order.setFixOrder(true);
    order.setCreatedTime(System.currentTimeMillis());
    order.setOrderStatus((byte) 'a');
    order.setSide((byte) '1');

    order.apply();
    orders[(index++) % orders.length] = order;
}
 
Example 4
Project: benchmarks   File: ReentrantLockBenchmark.java   View source code 6 votes vote down vote up
@Benchmark
@BenchmarkMode({   Mode.Throughput})
  @OutputTimeUnit
    (TimeUnit.MILLISECONDS)
public long testUnfairLockContended(Contended contended )
{
	contended.unfairLock.lock();
	try{
		return execute();
	}
	finally
	{
		contended.unfairLock.unlock();
	}
	
	
	
}
 
Example 5
Project: benchmarks   File: ReentrantLockBenchmark.java   View source code 6 votes vote down vote up
@Benchmark
@BenchmarkMode({   Mode.Throughput})
  @OutputTimeUnit
    (TimeUnit.MILLISECONDS)
public long testFairLockContended(Contended contended)
{
	contended.fairLock.lock();
	try{
		return execute();
	}
	finally
	{
		contended.fairLock.unlock();
	}
	
	
	
}
 
Example 6
Project: protobuf-el   File: BuilderBenchmark.java   View source code 6 votes vote down vote up
@Benchmark
@BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime, Mode.SingleShotTime})
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 5, time = 100, timeUnit = TimeUnit.MICROSECONDS)
@Measurement(iterations = ITERATIONS_COUNT, time = 1000, timeUnit = TimeUnit.MICROSECONDS)
@Fork(1)
public Message timeMergeAndBuild() {
  dummy = ++dummy % Integer.MAX_VALUE;
  
  Builder builder = newBuilder(expectedMessage)
      .getFieldBuilder(galaxyStar, 0)
          .setField(starName, String.valueOf(dummy))
          .mergeFrom(mergeStar1Message)
          .getFieldBuilder(starPlanet, 0)
              .mergeFrom(mergePlanet1Message)
              .toParent()
          .toParent();
  
  return builder.build();
}
 
Example 7
Project: protobuf-el   File: BuilderBenchmark.java   View source code 6 votes vote down vote up
@Benchmark
@BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime, Mode.SingleShotTime})
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 5, time = 100, timeUnit = TimeUnit.MICROSECONDS)
@Measurement(iterations = ITERATIONS_COUNT, time = 1000, timeUnit = TimeUnit.MICROSECONDS)
@Fork(1)
public Galaxy timeMergeAndBuildOriginalGM() {
  dummy = ++dummy % Integer.MAX_VALUE;
  
  Galaxy.Builder builder = Galaxy.newBuilder((Galaxy) expectedMessage);
  builder.getStarBuilder(0)
      .setName(String.valueOf(dummy))
      .mergeFrom(mergeStar1Message)
      .getPlanetBuilder(0)
      .mergeFrom(mergePlanet1Message);
  
  return builder.build();    
}
 
Example 8
Project: pinot   File: BenchmarkOfflineIndexReader.java   View source code 6 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public int stringDictionary() {
  int length = _stringDictionary.length();
  int ret = 0;
  int[] dictIds = new int[NUM_ROUNDS];
  for (int i = 0; i < NUM_ROUNDS; i++) {
    int dictId = RANDOM.nextInt(length);
    String value = _stringDictionary.getStringValue(dictId);
    ret += _stringDictionary.indexOf(value);
    dictIds[i] = dictId;
  }
  String[] outValues = new String[NUM_ROUNDS];
  _stringDictionary.readStringValues(dictIds, 0, NUM_ROUNDS, outValues, 0);
  for (int i = 0; i < NUM_ROUNDS; i++) {
    ret += outValues[0].length();
  }
  return ret;
}
 
Example 9
Project: beanvalidation-benchmark   File: ParsingBeansSpeedBenchmark.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Fork(value = 1)
@Threads(1)
@Warmup(iterations = 5)
@Measurement(iterations = 20)
public void testCascadedValidation(ParsingBeansSpeedState state, Blackhole bh) {
	// Validator in new factory

	for ( Object o : state.holder.beans ) {
		bh.consume( state.validator.getConstraintsForClass( o.getClass() ).isBeanConstrained() );
	}
}
 
Example 10
Project: beanvalidation-benchmark   File: RawValidationSpeedBenchmark.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@Threads(50)
@Warmup(iterations = 20) // it seems that as there are a lot of beans it takes some time to warmup
@Measurement(iterations = 30)
public void testCascadedValidation(RawValidationSpeedState state, Blackhole bh) {
	for ( Object o : state.holder.beans ) {
		Set<ConstraintViolation<Object>> constraintViolations = state.validator.validate( o );
		bh.consume( constraintViolations );
	}
}
 
Example 11
Project: faster-than-reflection   File: FasterThanReflectionBenchmark.java   View source code 5 votes vote down vote up
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@BenchmarkMode(Mode.AverageTime)
@Benchmark
public int testFieldAccessReflectionApi(FieldAccessReflectionApiState state)
		throws IllegalArgumentException, IllegalAccessException {
	return state.intValField.getInt(state.foo);
}
 
Example 12
Project: faster-than-reflection   File: FasterThanReflectionBenchmark.java   View source code 5 votes vote down vote up
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@BenchmarkMode(Mode.AverageTime)
@Benchmark
public int testPropertyAccessReflectionApi(PropertyAccessReflectionApiState state)
		throws IllegalAccessException, InvocationTargetException {
	return (int)state.intValAccessorMethod.invoke(state.foo);
}
 
Example 13
Project: preDict   File: LuceneBenchmark.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public List<String> testSingleSearch(Data data, Iterator i) {
	String query = null;
	while(query == null) {
		query = i.getNextQuery(data.queries);
	}
	return data.wordSearch.findSimilarWords(query);
}
 
Example 14
Project: prometheus-client   File: SummaryThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientSummaryThroughput() {
  promSummary = io.prometheus.client.Summary.build().name("name").help("help").create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promSummary.observe(i);
  }
}
 
Example 15
Project: prometheus-client   File: SummaryThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientSummaryThroughputWithLabels() {
  promSummary = io.prometheus.client.Summary.build().name("name").help("help").labelNames(LABEL_NAMES).create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promSummary.labels(LABEL_VALUES.get(i % LABEL_VALUES.size())).observe(i);
  }
}
 
Example 16
Project: prometheus-client   File: SummaryThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSummaryThroughput() {
  summary = new SummaryBuilder("name", "help").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    summary.observe(i);
  }
}
 
Example 17
Project: prometheus-client   File: SummaryThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSummaryThroughputWithLabels() {
  summary = new SummaryBuilder("name", "help").withReservoir().withUniformReservoir(1000).withLabels("label1", "label2").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    summary.observe(i, LABEL_VALUES.get(i % LABEL_VALUES.size()));
  }
}
 
Example 18
Project: prometheus-client   File: SettableGaugeLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientGaugeLatency() {
  promGauge = io.prometheus.client.Gauge.build().name("name").help("help").create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promGauge.inc();
  }
  actualIterations = promGauge.labels().get();
}
 
Example 19
Project: prometheus-client   File: SettableGaugeLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientGaugeLatencyWithLabels() {
  promGauge = io.prometheus.client.Gauge.build().name("name").help("help").labelNames(LABEL_NAMES).create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promGauge.labels(LABEL_VALUES).inc();
  }
  actualIterations = promGauge.labels(LABEL_VALUES).get();
}
 
Example 20
Project: prometheus-client   File: SettableGaugeLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSettableGaugeLatency() {
  gauge = new SettableGaugeBuilder("name", "help").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    gauge.set(i);
  }
  actualIterations = gauge.getValue() + 1;
}
 
Example 21
Project: prometheus-client   File: SettableGaugeLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSettableGaugeLatencyWithLabels() {
  gauge = new SettableGaugeBuilder("name", "help").withLabels("label1", "label2").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    gauge.set(i, LABEL_VALUES);
  }
  actualIterations = gauge.getValue(LABEL_VALUES) + 1;
}
 
Example 22
Project: prometheus-client   File: HistogramLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientGaugeLatency() {
  promHistogram = io.prometheus.client.Histogram.build().name("name").help("help").create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promHistogram.observe(i);
  }
}
 
Example 23
Project: prometheus-client   File: HistogramLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientGaugeLatencyWithLabels() {
  promHistogram = io.prometheus.client.Histogram.build().name("name").help("help").labelNames(LABEL_NAMES).create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promHistogram.labels(LABEL_VALUES).observe(i);
  }
}
 
Example 24
Project: prometheus-client   File: HistogramLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSettableGaugeLatency() {
  histogram = new HistogramBuilder("name", "help").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    histogram.observe(i);
  }
}
 
Example 25
Project: prometheus-client   File: HistogramLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSettableGaugeLatencyWithLabels() {
  histogram = new HistogramBuilder("name", "help").withLabels("label1", "label2").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    histogram.observe(i, LABEL_VALUES);
  }
}
 
Example 26
Project: prometheus-client   File: SettableGaugeThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientGaugeThroughput() {
  promGauge = io.prometheus.client.Gauge.build().name("name").help("help").create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promGauge.inc();
  }
  actualIterations = promGauge.labels().get();
}
 
Example 27
Project: prometheus-client   File: SettableGaugeThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientGaugeThroughputWithLabels() {
  promGauge = io.prometheus.client.Gauge.build().name("name").help("help").labelNames(LABEL_NAMES).create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promGauge.labels(LABEL_VALUES.get(i % LABEL_VALUES.size())).inc();
  }
  actualIterations = LABEL_VALUES.stream().mapToDouble(labelValues -> promGauge.labels(labelValues).get()).sum();
}
 
Example 28
Project: prometheus-client   File: SettableGaugeThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSettableGaugeThroughput() {
  gauge = new SettableGaugeBuilder("name", "help").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    gauge.set(i);
  }
  actualIterations = gauge.getValue() + 1;
}
 
Example 29
Project: prometheus-client   File: SettableGaugeThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSettableGaugeThroughputWithLabels() {
  gauge = new SettableGaugeBuilder("name", "help").withLabels("label1", "label2").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    gauge.set(i, LABEL_VALUES.get(i % LABEL_VALUES.size()));
  }
  actualIterations = LABEL_VALUES.stream()
    .mapToDouble(labelValues -> gauge.getValue(labelValues))
    .max()
    .orElseThrow(() -> new RuntimeException("Error")) + 1;
}
 
Example 30
Project: prometheus-client   File: SummaryLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientSummaryLatency() {
  promSummary = io.prometheus.client.Summary.build().name("name").help("help").create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promSummary.observe(i);
  }
}
 
Example 31
Project: prometheus-client   File: SummaryLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientSummaryLatencyWithLabels() {
  promSummary = io.prometheus.client.Summary.build().name("name").help("help").labelNames(LABEL_NAMES).create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    promSummary.labels(LABEL_VALUES).observe(i);
  }
}
 
Example 32
Project: prometheus-client   File: SummaryLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSettableSummaryLatency() {
  summary = new SummaryBuilder("name", "help").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    summary.observe(i);
  }
}
 
Example 33
Project: prometheus-client   File: SummaryLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSettableSummaryLatencyWithLabels() {
  summary = new SummaryBuilder("name", "help").withLabels("label1", "label2").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    summary.observe(i, LABEL_VALUES);
  }
}
 
Example 34
Project: prometheus-client   File: CounterLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientCounterLatency() {
  prometheusCounter = io.prometheus.client.Counter.build().name("name").help("help").create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    prometheusCounter.inc();
  }
  actualIterations = prometheusCounter.labels().get();
}
 
Example 35
Project: prometheus-client   File: CounterLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientCounterLatencyWithLabels() {
  prometheusCounter = io.prometheus.client.Counter.build().name("name").help("help").labelNames(LABEL_NAMES).create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    prometheusCounter.labels(LABEL_VALUES).inc();
  }
  actualIterations = prometheusCounter.labels(LABEL_VALUES).get();
}
 
Example 36
Project: prometheus-client   File: CounterLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureCounterLatency() {
  counter = new CounterBuilder("name", "help").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    counter.inc();
  }
  actualIterations = counter.getValue();
}
 
Example 37
Project: prometheus-client   File: CounterLatencyTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureCounterLatencyWithLabels() {
  counter = new CounterBuilder("name", "help").withLabels("label1", "label2").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    counter.inc(LABEL_VALUES);
  }
  actualIterations = counter.getValue(LABEL_VALUES);
}
 
Example 38
Project: prometheus-client   File: CounterThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientCounterThroughput() {
  prometheusCounter = io.prometheus.client.Counter.build().name("name").help("help").create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    prometheusCounter.inc();
  }
  actualIterations = prometheusCounter.labels().get();
}
 
Example 39
Project: prometheus-client   File: CounterThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureSimpleClientCounterThroughputWithLabels() {
  prometheusCounter = io.prometheus.client.Counter.build().name("name").help("help").labelNames(LABEL_NAMES).create();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    prometheusCounter.labels(LABEL_VALUES.get(i % LABEL_VALUES.size())).inc();
  }
  actualIterations = LABEL_VALUES.stream().mapToDouble(labelValues -> prometheusCounter.labels(labelValues).get()).sum();
}
 
Example 40
Project: prometheus-client   File: CounterThroughputTest.java   View source code 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void measureCounterThroughput() {
  counter = new CounterBuilder("name", "help").build();
  for (int i = 0; i < NUM_OF_ITERATIONS; i++) {
    counter.inc();
  }
  actualIterations = counter.getValue();
}