首页 > 解决方案 > gremlin - show query execution time

问题描述

How do you show the query execution time for a gremlin query while running it a console such as Datastax Studio?

I tried

clockWithResult(100) { myquery }

But I get an error saying "cannot convert from int to Supplier"

标签: gremlindatastax-enterprise-graph

解决方案


我很确定这clockWithResult()是一个仅由 Gremlin Console 提供的功能,而不是 Gremlin 语言本身的一部分。其他 Gremlin 工具(如 DS Studio)没有我所知道的特定功能。如果您真的想使用该功能,您应该将 Gremlin Console 连接到 DataStax Graph 并从那里执行您的查询。

也就是说,clockWithResult()只是其中的一个成员TimeUtil,可以在这里找到。您可以:

  1. 尝试修改 DS Graph 沙盒白名单以允许使用该类,然后通过 Studio 使用它或
  2. 如果该方法由于某种原因不起作用,只需将该功能代码复制/粘贴到 Studio 单元并直接使用它(我很确定这会起作用,但还没有尝试过)。

推荐阅读