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

io.ebeaninternal.metric.TimedMetric Maven / Gradle / Ivy

There is a newer version: 15.6.0
Show newest version
package io.ebeaninternal.metric;

import io.ebean.meta.MetricVisitor;

/**
 * Metric for timed events like transaction execution times.
 */
public interface TimedMetric {

  /**
   * Add a time event (usually in microseconds).
   */
  void add(long micros);

  /**
   * Add a time event with the number of loaded beans or rows.
   */
  void add(long micros, long beans);

  /**
   * Return true if there are no metrics collected since the last collection.
   */
  boolean isEmpty();

  /**
   * Reset the statistics.
   */
  void reset();

  /**
   * Collect and return a snapshot of the metrics.
   */
  TimedMetricStats collect(boolean reset);

  /**
   * Visit non empty metrics.
   */
  void visit(MetricVisitor visitor);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy