Latency measurement in python deepstream implementation

On a native deepstream app, we are able to get the frame latency and plugin latency, by enabling latency measurement with below commands.
export NVDS_ENABLE_LATENCY_MEASUREMENT=1
export NVDS_ENABLE_COMPONENT_LATENCY_MEASUREMENT=1

Please let me know, how we can we can get similar latency measurements for a python based deepstream pipeline.

These capabilities are exposed via the deepstream API :
https://docs.nvidia.com/metropolis/deepstream/4.0/dev-guide/DeepStream_Development_Guide/baggage/group__ee__nvlatency__group.html

So you should be able to use these APIs directly from your python code.

I hope this note helps.