All Downloads are FREE. Search and download functionalities are using the official Maven repository.

se.l4.vibe.builder.TimerBuilder Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
package se.l4.vibe.builder;

import se.l4.vibe.percentile.PercentileCounter;
import se.l4.vibe.timer.Timer;

/**
 * Builder for instances of {@link Timer}.
 * 
 * @author Andreas Holstenson
 *
 */
public interface TimerBuilder
	extends Builder
{
	/**
	 * Measure how many timings fall within a predefined set of ranges. Ranges
	 * are given in milliseconds. 
	 * 
	 * Each bucket  represent a range, the first value given in this array is the 
	 * start of the first bucket and the last one is the upper bound for the 
	 * next to last bucket.
	 * 
	 * 

* Example: *

	 * withBuckets(0, 100, 400, 500)
	 * 
* * Buckets created: *
    *
  1. 0-100
  2. *
  3. 101-400
  4. *
  5. 401-500
  6. *
  7. 501-*
  8. *
* *

* This will enable percentile calculations for this timer. * * @param limits * @return */ TimerBuilder withBuckets(int... limits); /** * Set the percentile counter to use for this timer. The counter should be setup * to measure things in nanoseconds. * * @param counter * @return */ TimerBuilder withPercentiles(PercentileCounter counter); /** * Build and return the timer without exporting it. * * @return */ Timer build(); /** * Export and return the timer. * * @return */ Timer export(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy