Profiling Neptune from javascript

Hi, I'm looking to profile some existing gremlin queries via Neptune so I can understand the current performance and then optimise. Looking at the documentation, there isa http endpoint at "<endpoint>:<port>/gremlin/profile. I've been able to access this through curl, sending a serialised string. I would like to know what options I have to do this in javascript. I am currently using a wss connection, but noticed that swapping to https, I could still run my queries. I'd hoped that I could just add a '/profile' to my host url, but it wasn't so simple. I can see in the docs that I can also send in bytecode to the endpoint, and I've inspected the query object and found a bytecode object, which I assume is sent when I await the query. Is there a connection setup that will allow me to simply run my query as usual to get a profile out? If not, what options do I have available to me to profile my queries in Neptune? Thanks :gremlin_smile:
Solution:
Profiles for Gremlin queries either require using the HTTPS endpoint: https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html Or you can use the AWS SDK: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/neptunedata/command/ExecuteGremlinProfileQueryCommand/ There is no way to get this profile using the Gremlin drivers. ...
Gremlin profile API in Neptune - Amazon Neptune
The Gremlin profile feature in Neptune runs a specified traversal, collects metrics about the run, and produces a profile report.
Jump to solution
2 Replies
Solution
Dave
Dave4mo ago
Profiles for Gremlin queries either require using the HTTPS endpoint: https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html Or you can use the AWS SDK: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/neptunedata/command/ExecuteGremlinProfileQueryCommand/ There is no way to get this profile using the Gremlin drivers. Neptune supports both driver/WS based connections to the server and HTTPS/REST calls directly to the cluster endpoints. Besides the connection protocol there are a few differences, most notably that HTTPS responses will include all properties of elements in the graph by default and WS response do not.
Gremlin profile API in Neptune - Amazon Neptune
The Gremlin profile feature in Neptune runs a specified traversal, collects metrics about the run, and produces a profile report.
red
redOP4mo ago
thanks for your help, i'll have a look at the aws sdk or resort to the https endpoint directly

Did you find this page helpful?