Skip to content

Do not call flush extension after each invocation. #154

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

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

purple4reina
Copy link
Contributor

What does this PR do?

Only calls Flush() on the extension when running in local test mode.

See DataDog/datadog-lambda-python#406

Motivation

This cuts runtime duration of a hello world function by about 10%.

Testing Guidelines

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Checklist

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

@purple4reina purple4reina requested a review from a team as a code owner December 15, 2023 23:04
@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (73ccca7) 81.90% compared to head (db96efc) 82.07%.

❗ Current head db96efc differs from pull request most recent head 156f596. Consider uploading reports for the commit 156f596 to get more accurate results

Files Patch % Lines
internal/metrics/listener.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #154      +/-   ##
==========================================
+ Coverage   81.90%   82.07%   +0.17%     
==========================================
  Files          13       13              
  Lines         884      887       +3     
==========================================
+ Hits          724      728       +4     
+ Misses        131      129       -2     
- Partials       29       30       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@duncanista duncanista left a comment

Choose a reason for hiding this comment

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

LGTM – thanks for adding the 1 or true check.

@purple4reina purple4reina merged commit 292dafd into main Dec 19, 2023
@purple4reina purple4reina deleted the rey.abolofia/no-flush branch December 19, 2023 17:37
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