C# Profiling Duration

Does anyone have an example of how to get the millisecond/microsecond execution time of a query in C#? I can't find any examples of this online.
Solution:
I don't have really good alternative. Option is to run same traversal from Gremlin Console or java GLV. If you have GremlinGroovyScriptEngine (it's default for TinkerPop 3.6-3.7) then workaround is to convert response to string or Map before sending back from server, something like await client.SubmitWithSingleResultAsync<Object>("g.V().profile().toList().toString()");...
Jump to solution
6 Replies
Valentyn Kahamlyk
Stopwatch Class (System.Diagnostics)
Provides a set of methods and properties that you can use to accurately measure elapsed time.
ibiswas
ibiswas6mo ago
Are there any caveats with using profile() in dotnet ? Is it as simple as g.<query>.Profile() ? Also what's the format of the response ?
Valentyn Kahamlyk
profile() will not work, dotnet GLV can't deserialize server response of TraversalMetrics type
ibiswas
ibiswas6mo ago
is there an alternative to profile in that case ?
Solution
Valentyn Kahamlyk
I don't have really good alternative. Option is to run same traversal from Gremlin Console or java GLV. If you have GremlinGroovyScriptEngine (it's default for TinkerPop 3.6-3.7) then workaround is to convert response to string or Map before sending back from server, something like await client.SubmitWithSingleResultAsync<Object>("g.V().profile().toList().toString()");
ibiswas
ibiswas6mo ago
ok we'll try this. Thanks @Valentyn Kahamlyk
Want results from more Discord servers?
Add your server