Package io.ebean.meta
Interface MetaInfoManager
-
public interface MetaInfoManager
Provides access to the meta data in Database such as query execution statistics.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ServerMetrics
collectMetrics()
Return the metrics for the database instance.List<MetricData>
collectMetricsAsData()
Return the metrics as a list of MetricData.ServerMetricsAsJson
collectMetricsAsJson()
Collect the metrics in raw JSON form.List<MetaQueryPlan>
queryPlanCollectNow(QueryPlanRequest request)
Collect query plans in the foreground.List<MetaQueryPlan>
queryPlanInit(QueryPlanInit initRequest)
Initiate query plan collection by turning on "bind capture" on matching query plans.void
resetAllMetrics()
Just reset all the metrics.BasicMetricVisitor
visitBasic()
Run a visit collecting all the metrics and returning BasicMetricVisitor which holds all the metrics in simple lists.void
visitMetrics(MetricVisitor visitor)
Visit the metrics resetting and collecting/reporting as desired.
-
-
-
Method Detail
-
collectMetrics
ServerMetrics collectMetrics()
Return the metrics for the database instance.This will reset the metrics (reset counters back to zero etc) and will only return the non-empty metrics.
-
collectMetricsAsJson
ServerMetricsAsJson collectMetricsAsJson()
Collect the metrics in raw JSON form.String metricsJson = database.getMetaInfoManager() .collectMetricsAsJson() .json();
-
collectMetricsAsData
List<MetricData> collectMetricsAsData()
Return the metrics as a list of MetricData.
-
visitMetrics
void visitMetrics(MetricVisitor visitor)
Visit the metrics resetting and collecting/reporting as desired.
-
visitBasic
BasicMetricVisitor visitBasic()
Run a visit collecting all the metrics and returning BasicMetricVisitor which holds all the metrics in simple lists.
-
resetAllMetrics
void resetAllMetrics()
Just reset all the metrics. Maybe only useful for testing purposes.
-
queryPlanInit
List<MetaQueryPlan> queryPlanInit(QueryPlanInit initRequest)
Initiate query plan collection by turning on "bind capture" on matching query plans.Also refer to DatabaseConfig collectQueryPlans that needs to be set to true and collectQueryPlanThresholdMicros which is a global defaults that can also initiate query plan capture.
- Returns:
- The query plans that have had bind capture turned on by this request.
-
queryPlanCollectNow
List<MetaQueryPlan> queryPlanCollectNow(QueryPlanRequest request)
Collect query plans in the foreground.
-
-