使用java评测neo4j数据库命中率

使用java评测neo4j数据库命中率,java,neo4j,Java,Neo4j,我试图使用以下代码分析neo4j数据库的点击 public int calculateHits(List<ExecutionPlanDescription> list) { int hits = 0; int head = 0; if (list.isEmpty()) return 0; if (list.get(head).hasProfilerStatistics()) { hits += list.get(hea

我试图使用以下代码分析neo4j数据库的点击

public int calculateHits(List<ExecutionPlanDescription> list) {
    int hits = 0;
    int head = 0;
    if (list.isEmpty())
        return 0;

    if (list.get(head).hasProfilerStatistics()) {
        hits += list.get(head).getProfilerStatistics().getDbHits();
        System.out.println(hits);
    }
    hits += calculateHits(list.get(head).getChildren()); // recurse over the children of the head
    list.remove(head); // remove the head to recurse on the remaining of the list
    hits += calculateHits(list);
    return hits;
}
但是,该方法始终返回0个命中。我记录了queryExecuter计划的名称,并找到了聚合、筛选器。展开(全部)、筛选和节点标签扫描计划。但似乎并非所有计划都存在profilerStatistics,因为它从不访问条件并增加命中率


代码中是否有任何问题,或者我需要先进行某些配置以分析数据库命中率。。。谢谢你的帮助。谢谢

我终于解决了这个问题!我必须在查询中使用profile来填充统计数据并获得数据库命中率。因此,查询应该是

PROFILE Match (e:Event)-[r:has_metadata]-> (s:EventMetadata) where s.type STARTS WITH 'ELec' AND s.eventLocation IN ["GW", "GW32", "FW", "FW29" , "SW", "SW00"] AND e.date="1/11/2016" return SUM( e.reading)}

显示正在执行的密码查询的详细示例。
Match(e:Event)-[r:has_metadata]->(s:EventMetadata),其中s.type以'ELec'开头,s.eventLocation以[“GW”、“GW32”、“FW”、“FW29”、“SW”、“SW00”]和e.date=“1/11/2016”返回和(e.reading)
我终于解决了问题!我必须在查询中使用profile来填充统计数据并获得数据库命中率。因此,查询应该是
PROFILE Match(e:Event)-[r:has_metadata]->(s:EventMetadata),其中s.type以“'ELec”开头,s.eventLocation位于[“GW”、“GW32”、“FW”、“FW29”、“SW”、“SW00”]和e.date=“1/11/2016”返回和(e.reading)
PROFILE Match (e:Event)-[r:has_metadata]-> (s:EventMetadata) where s.type STARTS WITH 'ELec' AND s.eventLocation IN ["GW", "GW32", "FW", "FW29" , "SW", "SW00"] AND e.date="1/11/2016" return SUM( e.reading)}