简体   繁体   English

gremlin - 显示查询执行时间

[英]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?在 Datastax Studio 等控制台上运行 gremlin 查询时,如何显示查询执行时间?

I tried我试过

clockWithResult(100) { myquery }

But I get an error saying "cannot convert from int to Supplier"但我收到一条错误消息“无法从 int 转换为 Supplier”

I'm pretty sure that clockWithResult() is a function provided only by Gremlin Console and is not part of the Gremlin language itself.我很确定clockWithResult()是仅由 Gremlin 控制台提供的 function,它不是 Gremlin 语言本身的一部分。 Other Gremlin tools (like DS Studio) don't have that specific feature that I'm aware of.其他 Gremlin 工具(如 DS Studio)没有我所知道的特定功能。 If you really want to use that feature you should connect Gremlin Console to DataStax Graph and execute your query from there.如果您真的想使用该功能,您应该将 Gremlin 控制台连接到 DataStax Graph 并从那里执行查询。

That said, clockWithResult() is just a member of TimeUtil which can be found here .也就是说, clockWithResult()只是TimeUtil的一个成员,可以在此处找到。 You could either:你可以:

  1. Try to modify the DS Graph sandbox whitelist to allow that class to be used and then use it through Studio OR尝试修改 DS Graph 沙盒白名单以允许使用 class,然后通过 Studio 使用它或
  2. If that approach doesn't work for some reason, just copy/paste that function code to a Studio cell and use it directly (I'm mostly sure that would work, but haven't tried).如果该方法由于某种原因不起作用,只需将 function 代码复制/粘贴到 Studio 单元格并直接使用它(我很确定这会起作用,但还没有尝试过)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM