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

Bug fix: fix postgres activity inflated query durations #11765

Merged
merged 1 commit into from
Apr 4, 2022

Conversation

jmeunier28
Copy link
Contributor

What does this PR do?

Adds a new column to activity queries for postgres, now, which is collected by calling the clock_timestamp() function. This will allow us to ingest the current time as seen by the database itself, and use that for our duration calculations for active queries in the backend.

Motivation

For the postgres integration, we're setting duration as payloadTimestamp - query_start, but payloadTimestamp is now() as calculated by the agent. It should instead be clock_timestamp() as reported by the database when the activity query is made.

This is likely adding 10-20 ms to our Postgres activity query durations.

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #11765 (f76a27a) into master (132d263) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Flag Coverage Δ
postgres 91.83% <100.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@steveny91 steveny91 merged commit 3e58b34 into master Apr 4, 2022
@steveny91 steveny91 deleted the jmeunier/DBM-1123 branch April 4, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants