-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdk/log: Fix counting number of dropped attributes of log.Record (#5464)
Applying attribute limits in `Record` uses value receiver. But it should add count of dropped attrs. In this PR I add using of pointer receiver. Also it's slightly faster with pointer receiver: ``` goos: darwin goarch: arm64 pkg: go.opentelemetry.io/otel/sdk/log │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ SetAddAttributes-10 175.7n ± 3% 159.8n ± 4% -9.08% (p=0.000 n=10) │ old.txt │ new.txt │ │ B/op │ B/op vs base │ SetAddAttributes-10 48.00 ± 0% 48.00 ± 0% ~ (p=1.000 n=10) ¹ ¹ all samples are equal │ old.txt │ new.txt │ │ allocs/op │ allocs/op vs base │ SetAddAttributes-10 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹ ¹ all samples are equal ```
- Loading branch information
Showing
3 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters