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

transaction: Stop recording breakdown metrics #1167

Merged
merged 4 commits into from
Jan 4, 2022
Merged

transaction: Stop recording breakdown metrics #1167

merged 4 commits into from
Jan 4, 2022

Conversation

marclop
Copy link
Contributor

@marclop marclop commented Dec 8, 2021

Description

Stops recording the unused transaction breakdown metrics:

  • transaction.duration.{count,sum.us}
  • transaction.breakdown.count

Removes the 4 bytes of padding in breakdownTiming and changes the type
of spanTiming.count from uintptr to uint64, making 32 and 64 bit
architectures span counts equal in size, removing the need for padding.

Related issues

Closes #1139

Stops recording the unused transaction breakdown metrics:
* `transaction.duration.{count,sum.us}`
* `transaction.breakdown.count`

Signed-off-by: Marc Lopez Rubio <[email protected]>
@marclop marclop added enhancement New feature or request v8.0.0 labels Dec 8, 2021
breakdown.go Show resolved Hide resolved
breakdown.go Show resolved Hide resolved
@@ -86,7 +86,7 @@ func testBreakdownMetricsAlignment(t *testing.T, arch string) {
breakdownMetricsMapEntryObj.Type(), false, pkg, "breakdownTiming",
)
require.NotNil(t, breakdownTimingObj)
assert.Equal(t, []int{0}, breakdownTimingFieldIndex)
assert.Equal(t, []int{1}, breakdownTimingFieldIndex)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to change the index of the field for the test to pass since I've reordered them.

@apmmachine
Copy link
Contributor

apmmachine commented Dec 8, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-01-04T03:36:59.767+0000

  • Duration: 33 min 21 sec

  • Commit: 9ac231b

Test stats 🧪

Test Results
Failed 0
Passed 11977
Skipped 279
Total 12256

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark test.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

LGTM!

breakdown.go Outdated
// have calculated breakdown metrics. If breakdown metrics are
// enabled, this will be equal transaction.count.
breakdownCount uintptr
// Padding to ensure the span field below is 64-bit aligned.
Copy link
Member

Choose a reason for hiding this comment

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

Comment needs updating. Do we still need the padding? IIRC we want the struct size to be a multiple of 8 bytes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried removing the padding, but on 32-bit architecture the uintptr is 4 bytes rather than 8 (64-bit), making the total struct size 12 bytes in 32-bit architectures instead of the 16 that we get by default on 32-bit architectures.

We could arguably change the implementation to always use an uint64, which gives us a maximum value of 18,446,744,073,709,551,615 which is quite large already, not sure what benefit uintptr would give us since we're not using it for pointer references anyway.

I think switching to uint64 makes sense since instead of allocating padding bytes in memory, we'd use them for the actual count rather than having padding on 32-bit architectures, I'll make the change, but re-request a review from you to make sure we're ok with uint64 vs uintptr.

Copy link
Member

Choose a reason for hiding this comment

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

Looks sensible, and simpler - thanks.

Removes the 4 bytes of padding in `breakdownTiming` and changes the type
of `spanTiming.count` from `uintptr` to `uint64`, making 32 and 64 bit
architectures span counts equal in size, removing the need for padding.

Signed-off-by: Marc Lopez Rubio <[email protected]>
@marclop marclop requested a review from axw December 22, 2021 02:32
@marclop marclop marked this pull request as ready for review December 22, 2021 02:32
@marclop marclop enabled auto-merge (squash) January 4, 2022 03:37
@marclop marclop merged commit 7e472e4 into elastic:master Jan 4, 2022
@marclop marclop deleted the f/stop-recording-transaction-breakdown-metrics branch January 4, 2022 04:10
@simitt simitt added this to the 2.0 milestone Feb 9, 2022
@axw axw self-assigned this Feb 10, 2022
@axw
Copy link
Member

axw commented Feb 10, 2022

I don't think this can usefully be tested manually, but I'm open to ideas. The server doesn't record these metrics any more.

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.

[META 505] Stop recording transaction.duration.sum.us,count metrics
4 participants