feat(generator): add pipeline stage performance metrics#21
Open
kunalbhardwaj2006 wants to merge 1 commit into
Open
feat(generator): add pipeline stage performance metrics#21kunalbhardwaj2006 wants to merge 1 commit into
kunalbhardwaj2006 wants to merge 1 commit into
Conversation
Owner
Author
|
Hi @bruno 👋 This PR introduces a small metrics utility to track execution time of generator pipeline stages. The goal is to make it easier to identify slow steps in the asset generation process and help optimize the pipeline. I'd appreciate any feedback or suggestions for improving this approach. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a lightweight performance metrics utility for the generator pipeline.
The goal is to measure execution time for different pipeline stages so developers can better understand the performance characteristics of the generator.
Implementation
A new utility class has been added:
generator/src/metrics.py
The
PipelineMetricsclass allows developers to track the execution time of different pipeline stages using:metrics.start(stage_name)
metrics.end(stage_name)
At the end of execution, a report can be generated to show how long each stage took.
Example output:
PDF Download completed in 5.2 seconds
Question Extraction completed in 18.7 seconds
Classification completed in 92.3 seconds
Benefits
• Improves observability of the generator pipeline
• Helps identify performance bottlenecks
• Makes future optimization easier
Future Improvements
This metrics system could be extended with:
• structured logging
• exporting metrics to monitoring tools
• visualizing pipeline execution performance
Feedback and suggestions are welcome.