001package io.ebean.meta;
002
003/**
004 * Defines visitor to read and report the transaction and query metrics.
005 */
006public interface MetricVisitor {
007
008  /**
009   * Return true if the metrics should be reset.
010   */
011  boolean isReset();
012
013  /**
014   * Return true if we should visit the transaction metrics.
015   */
016  boolean isCollectTransactionMetrics();
017
018  /**
019   * Return true if we should visit the ORM and SQL query metrics.
020   */
021  boolean isCollectQueryMetrics();
022
023  /**
024   * Return true if we should visit the L2 cache metrics.
025   */
026  boolean isCollectL2Metrics();
027
028  /**
029   * Visit has started.
030   */
031  void visitStart();
032
033  /**
034   * Visit transaction metrics (and L2 cache metrics in future).
035   */
036  void visitTimed(MetaTimedMetric metric);
037
038  /**
039   * Visit DTO and SQL query metrics.
040   */
041  void visitQuery(MetaQueryMetric metric);
042
043  /**
044   * Visit a Counter metric.
045   */
046  void visitCount(MetaCountMetric metric);
047
048  /**
049   * Visit has completed.
050   */
051  void visitEnd();
052
053}