Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Capture metrics #136

Merged
merged 10 commits into from
Dec 18, 2024
Merged

[FEATURE] Capture metrics #136

merged 10 commits into from
Dec 18, 2024

Conversation

Deepak-Kesavan
Copy link
Contributor

@Deepak-Kesavan Deepak-Kesavan commented Dec 17, 2024

What

  • Added MetricsMixin to capture time taken in each step
  • Added capture_metrics decorator function

Why

  • To capture metrics and return the time taken

How

...

Relevant Docs

Related Issues or PRs

Zipstack/unstract#900

Dependencies Versions / Env Variables

Notes on Testing

...

Screenshots

...

Checklist

I have read and understood the Contribution Guidelines.

@Deepak-Kesavan Deepak-Kesavan self-assigned this Dec 17, 2024
Copy link
Contributor

@chandrasekharan-zipstack chandrasekharan-zipstack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - here are few suggestions for later

  1. Try using a base interface to inherit / implement necessary metrics capturing attributes and functions. With the current logic it might not be easy to extend to other parts of the SDK in a robust fashion
  2. Usage reason / self.__class__.__name__ can be a part of this metrics dict returned by the mixin class

src/unstract/sdk/metrics_mixin.py Outdated Show resolved Hide resolved
src/unstract/sdk/metrics_mixin.py Show resolved Hide resolved
src/unstract/sdk/metrics_mixin.py Outdated Show resolved Hide resolved
src/unstract/sdk/utils/common_utils.py Outdated Show resolved Hide resolved
src/unstract/sdk/metrics_mixin.py Outdated Show resolved Hide resolved
src/unstract/sdk/utils/common_utils.py Show resolved Hide resolved
@chandrasekharan-zipstack
Copy link
Contributor

@Deepak-Kesavan can you also ensure that errors during the metrics collection are suppressed and logged as a warning to not prevent the user from accessing something?

Copy link
Contributor

@chandrasekharan-zipstack chandrasekharan-zipstack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. @Deepak-Kesavan you might want to catch any exceptions coming from the wrapper / MetricsMixin and log them as warnings to not block a user from executing something

Copy link
Contributor

@gaya3-zipstack gaya3-zipstack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look fine.

@gaya3-zipstack gaya3-zipstack merged commit 8156743 into main Dec 18, 2024
1 check passed
@gaya3-zipstack gaya3-zipstack deleted the feature/capture-metrics branch December 18, 2024 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants