Performance Analysis (Latency)#
This guide will help you add environment variables to enable GST TRACER logs and store results in a file. By analyzing these logs, you can monitor pipeline performance metrics, identify potential bottlenecks, and optimize the pipeline for better efficiency.
Steps to enable GST TRACER logging#
Add the following environment variables to the
dlstreamer-pipeline-serverservice in thedocker-compose.yml fileGST_DEBUG
GST_TRACERS
GST_DEBUG_FILE
Example
services: dlstreamer-pipeline-server: image: ${DLSTREAMER_PIPELINE_SERVER_IMAGE} environment: ... - GST_DEBUG=GST_TRACER:7 - GST_TRACERS=latency_tracer(flags=element+pipeline) - GST_DEBUG_FILE=/tmp/trace.log ... volumes: - "/tmp:/tmp"
GST_DEBUG=GST_TRACER:7indicates that GStreamer is set to log trace messages at level 7 during a pipeline’s execution.GST_TRACERS=latency_tracer(flags=element+pipeline)instructs GStreamer to enable the DL Streamer latency tracer.flags=element+pipelinespecifies that the tracer should measure latency for both the entire pipeline and individual elements within it.GST_DEBUG_FILE=/tmp/trace.logspecifies the file where the logs will be written.
Start the Docker containers
docker compose up -d
Start a pipeline instance using the
POST/pipelines/{name}/{version} endpointRefer to the “Send a REST request to run the default Pallet Defect Detection pipeline” step in the Get Started Guide for an example.
View the logs
The
GST TRACERlogs are written to thetrace.logfile in thetmpdirectory. Since thetmpdirectory in the container is mounted to the localtmpdirectory, you can view the logs on your host machine.To view the contents of the file, use
cat trace.logTo follow the logs being written real-time, use
tail -f trace.logLatency tracer is the functionality provided by DL Streamer. Please refer to the DL Streamer Latency Tracer documentation for available configuration options and detailed description of latency logs interpretation.
Learn More#
For more information on the Gstreamer tracing and debug log levels, refer to the following links:
Known Issues#
Issue: The trace.log file will be overwritten every time a pipeline related operation is executed.
Workaround: Copy the log file as needed.
Issue: The pipeline latency measurement does not work when gvametapublish element is in the pipeline.
Workaround: Leverage element latency.