Javaドライバーを使用してCypherクエリの実行時間を調べようとしています。
Session session = driver.session();
session.run( "CREATE (a:Person {name:'Arthur', title:'King'})" );
StatementResult result = session.run( "Profile MATCH (a:Person) WHERE a.name = 'Arthur' RETURN a.name AS name, a.title AS title" );
しかし、StatementResultまたはResultSummaryのどこにも見つかりませんでしたStatementResult.consume(query)
。これは。によって返されます。
からdbヒットにアクセスできProfiledPlan
ましResultSummary
たが、時間に関する情報がありません。
neo4j javaドライバーを使用してCypherクエリの実行時間にアクセスする方法はありますか?
Neo4j Javaドライバーバージョン1.1.0以降、次のものがあります。
/**
* The time it took the server to make the result available for consumption.
*
* @param unit The unit of the duration.
* @return The time it took for the server to have the result available in the provided time unit.
*/
long resultAvailableAfter( TimeUnit unit );
/**
* The time it took the server to consume the result.
*
* @param unit The unit of the duration.
* @return The time it took for the server to consume the result in the provided time unit.
*/
long resultConsumedAfter( TimeUnit unit );
それはあなたに両方の時間を提供します:
メソッドはorg.neo4j.driver.v1.summary.ResultSummary
インターフェースにローカライズされています。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加