Metrics/Stopwatch timings of python SDK

#1

Hi
Can someone link me to some documentaiton or example of how to pull metrics/timings for a python operation.

NIQL
GET/UPSET

Etc

I guess the python version of

https://docs.couchbase.com/sdk-api/couchbase-java-client-2.1.4/com/couchbase/client/java/query/QueryMetrics.html

#2

Hi, the metrics for N1QL/Analytics queries can be retrieved via the metrics property in the value that is returned from bucket.n1ql_query. or bucket.analytics_query . Apologies for not documenting this, will do in the next SDK2 release.

Please note that the metrics come at the end, so calling the metrics function in advance will buffer the entire result set into memory, which may be very large. If possible, it is better to call this method after having iterated through the entire result.

Get/Upsert will return tracing metrics in the tracing_output attribute of the returned Result object.

See: https://docs.couchbase.com/python-sdk/2.5/threshold-logging.html for details

1 Like
#3

Thanks Ellis.

Really looking for the non N1QL metrics however. Meaning simple memcache/kv lookup set/get.

If I set a value on CB I want to be able to record how long I was in different parts of the call. Not using N1QL.

Couchbase
NETWORK/CLIENT

---- So just want to confirm that the debugging/tracing is the only option for this ? When using Python SDk.