-
Notifications
You must be signed in to change notification settings - Fork 197
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
transaction: Stop recording breakdown metrics #1167
Conversation
Stops recording the unused transaction breakdown metrics: * `transaction.duration.{count,sum.us}` * `transaction.breakdown.count` Signed-off-by: Marc Lopez Rubio <[email protected]>
@@ -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) |
There was a problem hiding this comment.
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.
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
There was a problem hiding this 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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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]>
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. |
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 typeof
spanTiming.count
fromuintptr
touint64
, making 32 and 64 bitarchitectures span counts equal in size, removing the need for padding.
Related issues
Closes #1139