Search in sources :

Example 1 with MutableMetrics

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);
}
Also used : MutableMetrics(org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics)

Example 2 with MutableMetrics

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);
    }
}
Also used : MutableMetrics(org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics)

Example 3 with MutableMetrics

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);
}
Also used : MutableMetrics(org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics)

Example 4 with MutableMetrics

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());
    }
}
Also used : DefaultMapEntry(org.apache.commons.collections4.keyvalue.DefaultMapEntry) MutableMetrics(org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics)

Aggregations

MutableMetrics (org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics)4 DefaultMapEntry (org.apache.commons.collections4.keyvalue.DefaultMapEntry)1