001package io.ebean.metric; 002 003import io.ebean.meta.MetricVisitor; 004 005/** 006 * Metric for timed events like transaction execution times. 007 */ 008public interface CountMetric { 009 010 /** 011 * Add to the counter. 012 */ 013 void add(long micros); 014 015 /** 016 * Increment the counter by 1. 017 */ 018 void increment(); 019 020 /** 021 * Return the count value. 022 */ 023 long get(boolean reset); 024 025 /** 026 * Return true if there are no metrics collected since the last collection. 027 */ 028 boolean isEmpty(); 029 030 /** 031 * Reset the statistics. 032 */ 033 void reset(); 034 035 /** 036 * Visit non empty metrics. 037 */ 038 void visit(MetricVisitor visitor); 039}