Commit 33715eb
authored
[chore][exporter/elasticsearch] Replace json.MarshalIndent with json.… (#46494)
…Marshal
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Comparing current main (on commit
b0c41a1) with this change:
```
goos: linux
goarch: amd64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter/internal/serializer/otelserializer/serializeprofiles cpu: 12th Gen Intel(R) Core(TM) i7-12700H
│ main-b0c41a15619a2da71ef89844966be6a4e3932891.txt │ new-36e8f74f1f4ae830272229ae13f7c8f9a4bead57.txt │
│ sec/op │ sec/op vs base │
HostResourceData_MarshalJSON/empty_data_map-20 1377.0n ± 6% 890.6n ± 8% -35.32% (p=0.000 n=10)
HostResourceData_MarshalJSON/small_data_map-20 2.332µ ± 2% 1.655µ ± 9% -29.02% (p=0.000 n=10)
HostResourceData_MarshalJSON/large_data_map-20 6.378µ ± 9% 4.571µ ± 6% -28.33% (p=0.000 n=10)
HostResourceData_MarshalJSON/data_with_empty_values-20 2.023µ ± 4% 1.431µ ± 8% -29.27% (p=0.000 n=10)
geomean 1.552µ 1.160µ -25.27%
│ main-b0c41a15619a2da71ef89844966be6a4e3932891.txt │ new-36e8f74f1f4ae830272229ae13f7c8f9a4bead57.txt │
│ B/op │ B/op vs base │
HostResourceData_MarshalJSON/empty_data_map-20 841.0 ± 0% 680.0 ± 0% -19.14% (p=0.000 n=10)
HostResourceData_MarshalJSON/small_data_map-20 1298.0 ± 0% 1008.0 ± 0% -22.34% (p=0.000 n=10)
HostResourceData_MarshalJSON/large_data_map-20 3.240Ki ± 0% 2.486Ki ± 0% -23.27% (p=0.000 n=10)
HostResourceData_MarshalJSON/data_with_empty_values-20 1121.0 ± 0% 896.0 ± 0% -20.07% (p=0.000 n=10)
geomean 951.4 786.1 -17.37%
¹ all samples are equal
│ main-b0c41a15619a2da71ef89844966be6a4e3932891.txt │ new-36e8f74f1f4ae830272229ae13f7c8f9a4bead57.txt │
│ allocs/op │ allocs/op vs base │
HostResourceData_MarshalJSON/empty_data_map-20 14.00 ± 0% 13.00 ± 0% -7.14% (p=0.000 n=10)
HostResourceData_MarshalJSON/small_data_map-20 24.00 ± 0% 23.00 ± 0% -4.17% (p=0.000 n=10)
HostResourceData_MarshalJSON/large_data_map-20 49.00 ± 0% 48.00 ± 0% -2.04% (p=0.000 n=10)
HostResourceData_MarshalJSON/data_with_empty_values-20 21.00 ± 0% 20.00 ± 0% -4.76% (p=0.000 n=10)
geomean 16.91 16.29 -3.65%
¹ all samples are equal
```
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
<!--Describe what testing was performed and which tests were added.-->
#### Testing
<!--Describe the documentation added.-->
#### Documentation
<!--Please delete paragraphs that you did not use before submitting.-->
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>1 parent 623b03f commit 33715eb
2 files changed
Lines changed: 72 additions & 1 deletion
File tree
- exporter/elasticsearchexporter/internal/serializer/otelserializer/serializeprofiles
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
0 commit comments