use of org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics in project janusgraph by JanusGraph.
the class TP3ProfileWrapper method addNested.
@Override
public QueryProfiler addNested(String groupName) {
// Flatten out AND/OR nesting
if (groupName.equals(AND_QUERY) || groupName.equals(OR_QUERY))
return this;
int nextId = (subMetricCounter++);
MutableMetrics nested = new MutableMetrics(metrics.getId() + "." + groupName + "_" + nextId, groupName);
metrics.addNested(nested);
return new TP3ProfileWrapper(nested);
}
use of org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics in project unipop by unipop-graph.
the class DocumentController method fillChildren.
// endregion
// region Elastic Queries
private void fillChildren(List<MutableMetrics> childMetrics, SearchResult result) {
if (childMetrics.size() > 0) {
MutableMetrics child = childMetrics.get(0);
child.setCount(TraversalMetrics.ELEMENT_COUNT_ID, result.getTotal());
child.setDuration(Long.parseLong(result.getJsonObject().get("took").toString()), TimeUnit.MILLISECONDS);
}
}
use of org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics in project titan by thinkaurelius.
the class TP3ProfileWrapper method addNested.
@Override
public QueryProfiler addNested(String groupName) {
//Flatten out AND/OR nesting
if (groupName.equals(AND_QUERY) || groupName.equals(OR_QUERY))
return this;
int nextId = (subMetricCounter++);
MutableMetrics nested = new MutableMetrics(metrics.getId() + "." + groupName + "_" + nextId, groupName);
metrics.addNested(nested);
return new TP3ProfileWrapper(nested);
}
use of org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics in project unipop by unipop-graph.
the class RowController method fillChildren.
private <E extends Element, S extends JdbcSchema<E>> void fillChildren(List<MutableMetrics> children, Map<S, Select> schemas) {
List<org.javatuples.Pair<Long, Integer>> timing = TimingExecuterListener.timing.values().stream().collect(Collectors.toList());
List<Map.Entry<S, Select>> sqls = schemas.entrySet().stream().collect(Collectors.toList());
for (int i = 0; i < sqls.size(); i++) {
org.javatuples.Pair<Long, Integer> timingCount = timing.get(i);
if (i < children.size()) {
MutableMetrics child = children.get(i);
if (timingCount != null) {
child.setCount(TraversalMetrics.ELEMENT_COUNT_ID, timingCount.getValue1());
child.setDuration(timingCount.getValue0(), TimeUnit.NANOSECONDS);
}
}
timing.remove(sqls.get(i).getValue().getSQL());
}
}
Aggregations