1476 - Query plan capture, initial wip capturing bind params (#1477)

* 1476 - Query plan capture, initial wip capturing bind params

* No effective change - Reset test default db to H2

* #1476 - Query plan capture, initial wip capturing bind params #1477

Update with consumer

* #1476 - Query plan capture, initial wip capturing bind params #1477

Update with query plan request

* #1476 - Query plan capture, initial wip capturing bind params #1477

Extract interface

* #1476 - Query plan capture, initial wip capturing bind params #1477

Extract interface
This commit is contained in:
Rob Bygrave authored and GitHub committed 2018-12-19 16:04:28 +13:00
1 parent e611353163
commit 94591954b3
108 files changed
+1908 -233

No files matched your search

@@ -7,7 +7,6 @@ import io.ebean.SqlUpdate;
import io.ebean.Transaction;
import io.ebean.ValuePair;
import io.ebean.annotation.DocStoreMode;
import io.ebean.annotation.Formula;
import io.ebean.bean.BeanCollection;
import io.ebean.bean.EntityBean;
import io.ebean.bean.EntityBeanIntercept;
@@ -30,6 +29,7 @@ import io.ebean.event.readaudit.ReadAuditLogger;
import io.ebean.event.readaudit.ReadAuditPrepare;
import io.ebean.event.readaudit.ReadEvent;
import io.ebean.meta.MetricVisitor;
import io.ebean.meta.QueryPlanRequest;
import io.ebean.plugin.BeanDocType;
import io.ebean.plugin.BeanType;
import io.ebean.plugin.ExpressionPath;
@@ -1652,6 +1652,14 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
return new DeployUpdateParser(this).parse(ormUpdateStatement);
}
public void collectQueryPlans(QueryPlanRequest request) {
for (CQueryPlan queryPlan : queryPlanCache.values()) {
if (request.includeLabel(queryPlan.getLabel())) {
queryPlan.collectQueryPlan(request);
}
}
}
/**
* Visit all the ORM query plan metrics (includes UpdateQuery with updates and deletes).
*/
@@ -21,6 +21,7 @@ import io.ebean.event.changelog.ChangeLogListener;
import io.ebean.event.changelog.ChangeLogPrepare;
import io.ebean.event.changelog.ChangeLogRegister;
import io.ebean.meta.MetricVisitor;
import io.ebean.meta.QueryPlanRequest;
import io.ebean.plugin.BeanType;
import io.ebean.util.AnnotationUtil;
import io.ebeaninternal.api.ConcurrencyMode;
@@ -1688,6 +1689,14 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
}
}
public void collectQueryPlans(QueryPlanRequest request) {
for (BeanDescriptor<?> desc : immutableDescriptorList) {
if (request.includeType(desc.getBeanType())) {
desc.collectQueryPlans(request);
}
}
}
/**
* Comparator to sort the BeanDescriptors by name.
*/