Measuring DeepStream pipeline latency

Hi,

Trying to figure out how to gather performance metrics for the deepstream reference app running the Object_Detector_SSD example. Ideally, I want to be able to track the frame latencies from ingestion until osd.

Following the post: How to measure PGIE latency?, I was able to view latency measurements for only the nvosd0 component. However, I am not able to view the frame latency since the num_sources_in_batch equals 0 inside the latency_measurement_buf_prob function (deepstream_app.c) when there should be 1 rtsp source.

Could you provide pointers to (1) see the frame latency (2) view latencies for more components than just the nvosd?

config

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=1
gie-kitti-output-dir=streamscl

[tiled-display]
enable=0
rows=1
columns=1
width=1280
height=720
gpu-id=0
nvbuf-memory-type=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=4
num-sources=1
uri=rtsp://192.168.1.251:8554/mystream
gpu-id=0
cudadec-memtype=0

[streammux]
gpu-id=0
live-source=1
batch-size=1
batched-push-timeout=40000
## Set muxer output width and height
width=1920
height=1080
enable-padding=0
nvbuf-memory-type=0

[sink0]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File
type=2
sync=1
source-id=0
gpu-id=0

[sink1]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming
type=4
#1=h264 2=h265
codec=1
sync=0
#iframeinterval=10
bitrate=4000
# set below properties in case of RTSPStreaming
rtsp-port=8554
udp-port=5400

[osd]
enable=1
gpu-id=0
border-width=3
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
batch-size=1
gie-unique-id=1
interval=0
labelfile-path=ssd_coco_labels.txt
model-engine-file=sample_ssd_relu6.uff_b1_fp32.engine
# model-engine-file=mec_v2.engine
config-file=config_infer_primary_ssd.txt
nvbuf-memory-type=0
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1

[tracker]
enable=1
tracker-width=640
tracker-height=368
ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
gpu-id=0
#enable-batch-process applicable to DCF only
enable-batch-process=1