Files
ebean/ebean-api/src/main/java/io/ebean/meta/MetricVisitor.java
T
Rob Bygrave c7bd6c8bde Support a naming convention function that can be applied to metrics names for reporting
For example, can apply a lower case underscore naming convention to the metrics names. This
can be done such that it doesn't have to be applied every time the metrics are collected and
reported.
2022-08-08 21:34:00 +12:00

61 lines
1.1 KiB
Java

package io.ebean.meta;
import java.util.function.Function;
/**
* Defines visitor to read and report the transaction and query metrics.
*/
public interface MetricVisitor {
/**
* Return the naming convention that should be applied to the reported metric names.
*/
Function<String, String> namingConvention();
/**
* Return true if the metrics should be reset.
*/
boolean reset();
/**
* Return true if we should visit the transaction metrics.
*/
boolean collectTransactionMetrics();
/**
* Return true if we should visit the ORM and SQL query metrics.
*/
boolean collectQueryMetrics();
/**
* Return true if we should visit the L2 cache metrics.
*/
boolean collectL2Metrics();
/**
* Visit has started.
*/
void visitStart();
/**
* Visit transaction metrics (and L2 cache metrics in future).
*/
void visitTimed(MetaTimedMetric metric);
/**
* Visit DTO and SQL query metrics.
*/
void visitQuery(MetaQueryMetric metric);
/**
* Visit a Counter metric.
*/
void visitCount(MetaCountMetric metric);
/**
* Visit has completed.
*/
void visitEnd();
}