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

Event normalization conversion optimization #36044

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

jeniawhite
Copy link
Contributor

What does this PR do?

I've noticed that event normalization takes up a lot of heap memory because it duplicates all of the event.
We can avoid doing that and normalize the event in-place.
The current benchmarks don't emphasize enough the performance gain.
I will attach actual flow benchmarks later on and there is still room for improvement because not everything is being done in-place, but product wise I've improved the common flows.

cloudbeat🐚 Evgbs-MacBook-Pro:common evgb$ benchstat old_events.txt new_events.txt 
goos: darwin
goarch: arm64
pkg: github.com/elastic/beats/v7/libbeat/common
                                                        │   old_events.txt    │                new_events.txt                │
                                                        │       sec/op        │        sec/op         vs base                │
TestConvertNestedMapStr-10                                  0.00003645n ± 25%     0.00004175n ±  25%        ~ (p=0.643 n=10)
TestConvertNestedStruct-10                                  0.00001595n ± 16%     0.00002005n ±  16%  +25.71% (p=0.001 n=10)
TestConvertWithNullEmission-10                             0.000008600n ± 23%    0.000011550n ±  18%  +34.30% (p=0.015 n=10)
TestNormalizeValue/pointers_are_dereferenced-10           0.0000011000n ± 18%   0.0000008000n ±  25%  -27.27% (p=0.041 n=10)
TestNormalizeValue/custom_uint64_type_ok-10               0.0000008000n ± 37%   0.0000008000n ±  12%        ~ (p=0.625 n=10)
TestNormalizeValue/array_of_custom_uint_type-10            0.000001700n ± 35%    0.000001650n ±  33%        ~ (p=0.503 n=10)
TestNormalizeValue/drop_nil_time_pointer-10               0.0000006500n ± 38%   0.0000007000n ±  14%        ~ (p=0.381 n=10)
TestNormalizeValue/uint8_value-10                         0.0000008000n ± 50%   0.0000008000n ±  12%        ~ (p=1.000 n=10)
TestNormalizeValue/string_value-10                        0.0000008000n ± 37%   0.0000007500n ±  47%        ~ (p=0.473 n=10)
TestNormalizeValue/array_of_ints-10                        0.000001100n ± 18%    0.000001000n ±  10%        ~ (p=0.703 n=10)
TestNormalizeValue/map[string]string_to_mapstr.M-10        0.000007500n ± 15%    0.000007250n ±  28%        ~ (p=0.402 n=10)
TestNormalizeValue/custom_bool_type-10                    0.0000008500n ± 41%   0.0000008000n ±  12%        ~ (p=0.877 n=10)
TestNormalizeValue/custom_uint64_type_masked-10           0.0000008000n ± 37%   0.0000008000n ±  12%        ~ (p=0.650 n=10)
TestNormalizeValue/array_of_custom_uint64_ok-10            0.000001450n ± 17%    0.000001350n ±  19%        ~ (p=0.565 n=10)
TestNormalizeValue/array_of_custom_int_type-10             0.000001450n ± 10%    0.000001700n ±  41%        ~ (p=0.441 n=10)
TestNormalizeValue/array_of_custom_uint64_masked-10        0.000001500n ± 20%    0.000001500n ±   7%        ~ (p=0.800 n=10)
TestNormalizeValue/NetString_supports_TextMarshaller-10    0.000001150n ± 22%    0.000001000n ±  30%        ~ (p=0.529 n=10)
TestNormalizeValue/uint64_masked-10                       0.0000008000n ± 25%   0.0000008000n ±  37%        ~ (p=0.528 n=10)
TestNormalizeValue/array_of_strings-10                     0.000001000n ± 10%    0.000001000n ±  20%        ~ (p=0.127 n=10)
TestNormalizeValue/custom_uint_type-10                    0.0000008000n ± 37%   0.0000008000n ±  37%        ~ (p=0.691 n=10)
TestNormalizeValue/drop_nil_string_pointer-10             0.0000007000n ± 43%   0.0000007000n ±  14%        ~ (p=0.654 n=10)
TestNormalizeValue/map[string][]string_to_mapstr.M-10      0.000006900n ± 29%    0.000007950n ±  58%  +15.22% (p=0.041 n=10)
TestNormalizeValue/custom_int_type-10                     0.0000008500n ± 18%   0.0000008000n ±  12%        ~ (p=0.573 n=10)
TestNormalizeValue/array_of_map_to_mapstr.M-10             0.000002350n ± 28%    0.000001850n ±   8%  -21.28% (p=0.013 n=10)
TestNormalizeValue/UUID_supports_TextMarshaller-10         0.000001200n ± 25%    0.000001200n ±  17%        ~ (p=0.806 n=10)
TestNormalizeValue/map_to_mapstr.M-10                      0.000001950n ± 18%    0.000001550n ±  29%        ~ (p=0.078 n=10)
TestNormalizeValue/array_of_bools-10                      0.0000010000n ± 10%   0.0000009000n ±  44%        ~ (p=0.464 n=10)
TestNormalizeValue/array_of_mapstr.M-10                    0.000002100n ± 19%    0.000002250n ± 104%        ~ (p=0.238 n=10)
TestNormalizeValue/int8_value-10                          0.0000008000n ± 25%   0.0000008000n ±  37%        ~ (p=1.000 n=10)
TestNormalizeValue/array_of_custom_bool_type-10            0.000001850n ± 14%    0.000001750n ±  20%        ~ (p=0.450 n=10)
TestNormalizeValue/nil-10                                 0.0000005500n ± 45%   0.0000006000n ±  17%        ~ (p=0.363 n=10)
TestNormalizeValue/bool_value-10                          0.0000007500n ± 47%   0.0000005500n ±  27%  -26.67% (p=0.036 n=10)
TestNormalizeValue/array_of_uint64_ok-10                  0.0000010000n ± 20%   0.0000007500n ±  33%  -25.00% (p=0.017 n=10)
TestNormalizeValue/array_of_uint64_masked-10               0.000001250n ± 36%    0.000001350n ±  33%        ~ (p=0.400 n=10)
TestNormalizeValue/float64_value-10                       0.0000006000n ± 33%   0.0000006000n ±  50%        ~ (p=0.130 n=10)
TestNormalizeValue/float32_value-10                       0.0000005500n ± 27%   0.0000005500n ±  27%        ~ (p=0.561 n=10)
TestNormalizeMapError-10                                    0.00001250n ± 16%     0.00001255n ±  20%        ~ (p=0.956 n=10)
TestJoinKeys-10                                            0.000001700n ± 18%    0.000001650n ±  15%        ~ (p=0.778 n=10)
TestMarshalUnmarshalMap-10                                 0.000008200n ± 15%    0.000008150n ±  33%        ~ (p=0.927 n=10)
TestMarshalUnmarshalArray-10                               0.000002950n ± 25%    0.000002850n ±  23%        ~ (p=0.867 n=10)
TestNormalizeTime-10                                        0.00006525n ± 13%     0.00006440n ±  14%        ~ (p=0.684 n=10)
ConvertToGenericEventNetString-10                                265.4n ±  2%          198.2n ±   1%  -25.34% (p=0.000 n=10)
ConvertToGenericEventMapStringString-10                         1051.5n ±  7%          992.2n ±   5%   -5.63% (p=0.000 n=10)
ConvertToGenericEventMapStr-10                                   393.9n ±  4%          250.4n ±   4%  -36.42% (p=0.000 n=10)
ConvertToGenericEventStringSlice-10                              243.7n ±  2%          169.9n ±   1%  -30.28% (p=0.000 n=10)
ConvertToGenericEventCustomStringSlice-10                        448.5n ±  1%          371.1n ±   1%  -17.26% (p=0.000 n=10)
ConvertToGenericEventStringPointer-10                            240.4n ±  1%          173.2n ±   2%  -27.97% (p=0.000 n=10)
TestDeDotJSON-10                                            0.00002465n ± 37%     0.00002365n ±  23%        ~ (p=0.197 n=10)
geomean                                                     0.00002060n           0.00001950n          -5.35%

                                                        │ old_events.txt │             new_events.txt             │
                                                        │      B/op      │     B/op      vs base                  │
TestConvertNestedMapStr-10                                  0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestConvertNestedStruct-10                                  0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestConvertWithNullEmission-10                              0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/pointers_are_dereferenced-10             0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_uint64_type_ok-10                 0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_uint_type-10             0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/drop_nil_time_pointer-10                 0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/uint8_value-10                           0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/string_value-10                          0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_ints-10                         0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/map[string]string_to_mapstr.M-10         0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_bool_type-10                      0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_uint64_type_masked-10             0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_uint64_ok-10             0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_int_type-10              0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_uint64_masked-10         0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/NetString_supports_TextMarshaller-10     0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/uint64_masked-10                         0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_strings-10                      0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_uint_type-10                      0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/drop_nil_string_pointer-10               0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/map[string][]string_to_mapstr.M-10       0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_int_type-10                       0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_map_to_mapstr.M-10              0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/UUID_supports_TextMarshaller-10          0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/map_to_mapstr.M-10                       0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_bools-10                        0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_mapstr.M-10                     0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/int8_value-10                            0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_bool_type-10             0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/nil-10                                   0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/bool_value-10                            0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_uint64_ok-10                    0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_uint64_masked-10                0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/float64_value-10                         0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/float32_value-10                         0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeMapError-10                                    0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestJoinKeys-10                                             0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestMarshalUnmarshalMap-10                                  0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestMarshalUnmarshalArray-10                                0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeTime-10                                        0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
ConvertToGenericEventNetString-10                           720.0 ± 0%       384.0 ± 0%  -46.67% (p=0.000 n=10)
ConvertToGenericEventMapStringString-10                   1.695Ki ± 0%     1.367Ki ± 0%  -19.35% (p=0.000 n=10)
ConvertToGenericEventMapStr-10                             1344.0 ± 0%       672.0 ± 0%  -50.00% (p=0.000 n=10)
ConvertToGenericEventStringSlice-10                         728.0 ± 0%       392.0 ± 0%  -46.15% (p=0.000 n=10)
ConvertToGenericEventCustomStringSlice-10                   864.0 ± 0%       528.0 ± 0%  -38.89% (p=0.000 n=10)
ConvertToGenericEventStringPointer-10                       688.0 ± 0%       352.0 ± 0%  -48.84% (p=0.000 n=10)
TestDeDotJSON-10                                            0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
geomean                                                                ²                  -6.68%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                                        │ old_events.txt │            new_events.txt            │
                                                        │   allocs/op    │ allocs/op   vs base                  │
TestConvertNestedMapStr-10                                  0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestConvertNestedStruct-10                                  0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestConvertWithNullEmission-10                              0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/pointers_are_dereferenced-10             0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_uint64_type_ok-10                 0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_uint_type-10             0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/drop_nil_time_pointer-10                 0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/uint8_value-10                           0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/string_value-10                          0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_ints-10                         0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/map[string]string_to_mapstr.M-10         0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_bool_type-10                      0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_uint64_type_masked-10             0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_uint64_ok-10             0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_int_type-10              0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_uint64_masked-10         0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/NetString_supports_TextMarshaller-10     0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/uint64_masked-10                         0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_strings-10                      0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_uint_type-10                      0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/drop_nil_string_pointer-10               0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/map[string][]string_to_mapstr.M-10       0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/custom_int_type-10                       0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_map_to_mapstr.M-10              0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/UUID_supports_TextMarshaller-10          0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/map_to_mapstr.M-10                       0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_bools-10                        0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_mapstr.M-10                     0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/int8_value-10                            0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_custom_bool_type-10             0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/nil-10                                   0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/bool_value-10                            0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_uint64_ok-10                    0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/array_of_uint64_masked-10                0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/float64_value-10                         0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeValue/float32_value-10                         0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeMapError-10                                    0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestJoinKeys-10                                             0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestMarshalUnmarshalMap-10                                  0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestMarshalUnmarshalArray-10                                0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
TestNormalizeTime-10                                        0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
ConvertToGenericEventNetString-10                           8.000 ± 0%     6.000 ± 0%  -25.00% (p=0.000 n=10)
ConvertToGenericEventMapStringString-10                     22.00 ± 0%     20.00 ± 0%   -9.09% (p=0.000 n=10)
ConvertToGenericEventMapStr-10                              8.000 ± 0%     4.000 ± 0%  -50.00% (p=0.000 n=10)
ConvertToGenericEventStringSlice-10                         6.000 ± 0%     4.000 ± 0%  -33.33% (p=0.000 n=10)
ConvertToGenericEventCustomStringSlice-10                   13.00 ± 0%     11.00 ± 0%  -15.38% (p=0.000 n=10)
ConvertToGenericEventStringPointer-10                       5.000 ± 0%     3.000 ± 0%  -40.00% (p=0.000 n=10)
TestDeDotJSON-10                                            0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹

Why is it important?

This is a hot-path for event handling and reducing the memory allocations will improve the performance of events

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 11, 2023
@botelastic
Copy link

botelastic bot commented Jul 11, 2023

This pull request doesn't have a Team:<team> label.

@jeniawhite jeniawhite added enhancement backport-skip Skip notification from the automated backport with mergify labels Jul 11, 2023
@mergify
Copy link
Contributor

mergify bot commented Jul 11, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @jeniawhite? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 11, 2023

💔 Tests Failed

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: 2023-09-19T11:29:57.994+0000

  • Duration: 71 min 4 sec

Test stats 🧪

Test Results
Failed 4
Passed 28170
Skipped 1996
Total 30170

Test errors 4

Expand to view the tests failures

Build&Test / libbeat-unitTest / TestNormalization/no_sharing_if_normalized – github.com/elastic/beats/v7/libbeat/publisher/processing
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestNormalization/no_sharing_if_normalized
    === PAUSE TestNormalization/no_sharing_if_normalized
    === CONT  TestNormalization/no_sharing_if_normalized
        default_test.go:380: 
            	Error Trace:	/var/lib/jenkins/workspace/PR-36044-5-69347d4a-63ad-47d6-894b-837fbb5ca1d8/src/github.com/elastic/beats/libbeat/publisher/processing/default_test.go:380
            	Error:      	Not equal: 
            	            	expected: {"a":"b"}
            	            	actual  : {"a":"b","change":"x"}
            	            	
            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -1,3 +1,4 @@
            	            	-(mapstr.M) (len=1) {
            	            	- (string) (len=1) "a": (string) (len=1) "b"
            	            	+(mapstr.M) (len=2) {
            	            	+ (string) (len=1) "a": (string) (len=1) "b",
            	            	+ (string) (len=6) "change": (string) (len=1) "x"
            	            	 }
            	Test:       	TestNormalization/no_sharing_if_normalized
    --- FAIL: TestNormalization/no_sharing_if_normalized (0.00s)
     
    

Build&Test / libbeat-unitTest / TestNormalization – github.com/elastic/beats/v7/libbeat/publisher/processing
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestNormalization
    --- FAIL: TestNormalization (0.00s)
     
    

Build&Test / libbeat-goIntegTest / TestNormalization/no_sharing_if_normalized – github.com/elastic/beats/v7/libbeat/publisher/processing
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestNormalization/no_sharing_if_normalized
    === PAUSE TestNormalization/no_sharing_if_normalized
    === CONT  TestNormalization/no_sharing_if_normalized
        default_test.go:380: 
            	Error Trace:	/var/lib/jenkins/workspace/PR-36044-5-00d7cc4e-94dc-4c70-a865-1e8c07288c8c/src/github.com/elastic/beats/libbeat/publisher/processing/default_test.go:380
            	Error:      	Not equal: 
            	            	expected: {"a":"b"}
            	            	actual  : {"a":"b","change":"x"}
            	            	
            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -1,3 +1,4 @@
            	            	-(mapstr.M) (len=1) {
            	            	- (string) (len=1) "a": (string) (len=1) "b"
            	            	+(mapstr.M) (len=2) {
            	            	+ (string) (len=1) "a": (string) (len=1) "b",
            	            	+ (string) (len=6) "change": (string) (len=1) "x"
            	            	 }
            	Test:       	TestNormalization/no_sharing_if_normalized
    --- FAIL: TestNormalization/no_sharing_if_normalized (0.00s)
     
    

Build&Test / libbeat-goIntegTest / TestNormalization – github.com/elastic/beats/v7/libbeat/publisher/processing
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestNormalization
    --- FAIL: TestNormalization (0.00s)
     
    

Steps errors 7

Expand to view the steps failures

libbeat-unitTest - mage build unitTest
  • Took 4 min 59 sec . View more details here
  • Description: mage build unitTest
libbeat-unitTest - mage build unitTest
  • Took 2 min 46 sec . View more details here
  • Description: mage build unitTest
libbeat-unitTest - mage build unitTest
  • Took 2 min 45 sec . View more details here
  • Description: mage build unitTest
libbeat-goIntegTest - mage goIntegTest
  • Took 7 min 24 sec . View more details here
  • Description: mage goIntegTest
libbeat-goIntegTest - mage goIntegTest
  • Took 4 min 35 sec . View more details here
  • Description: mage goIntegTest
libbeat-goIntegTest - mage goIntegTest
  • Took 4 min 35 sec . View more details here
  • Description: mage goIntegTest
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: Error 'hudson.AbortException: script returned exit code 1'

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Genuine test errors 4

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Build&Test / libbeat-unitTest / TestNormalization/no_sharing_if_normalized – github.com/elastic/beats/v7/libbeat/publisher/processing
  • Name: Build&Test / libbeat-unitTest / TestNormalization – github.com/elastic/beats/v7/libbeat/publisher/processing
  • Name: Build&Test / libbeat-goIntegTest / TestNormalization/no_sharing_if_normalized – github.com/elastic/beats/v7/libbeat/publisher/processing
  • Name: Build&Test / libbeat-goIntegTest / TestNormalization – github.com/elastic/beats/v7/libbeat/publisher/processing

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@alexsapran
Copy link
Contributor

/test

@elasticmachine
Copy link
Collaborator

💔 Build Failed

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

  • Duration: 129 min 49 sec

Pipeline error 1

This error is likely related to the pipeline itself. Click here
and then you will see the error (either incorrect syntax or an invalid configuration).

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@elasticmachine
Copy link
Collaborator

💔 Build Failed

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

  • Duration: 133 min 6 sec

Pipeline error 1

This error is likely related to the pipeline itself. Click here
and then you will see the error (either incorrect syntax or an invalid configuration).

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@rdner
Copy link
Member

rdner commented Nov 28, 2023

@jeniawhite the test failures look legit, could you fix it?

It's obviously a big performance gain, however, I'm concerned about mutating events with this new implementation. It's, unfortunately, almost impossible to know if it's completely safe. To make sure of it, we would need to review the rest of the codebase and conclude if missing the cloning step here is fine.

However, since it's just normalisation, in case shared maps referenced in the event get normalised there is not much of an impact for our customers. I don't see any possible data corruption in this particular case.

)

func TestConvertNestedMapStr(t *testing.T) {
func BenchmarkTestConvertNestedMapStr(b *testing.B) {
Copy link
Member

Choose a reason for hiding this comment

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

Please don't convert regular tests to benchmarks. Our CI does not run benchmarks therefore does not fail on their failure.

We need a separate simple benchmark.

@jeniawhite jeniawhite force-pushed the evgb-NormalizeInplace branch from 14a2aba to 15dd5c1 Compare December 6, 2023 15:49
@elasticmachine
Copy link
Collaborator

❕ Build Aborted

Either there was a build timeout or someone aborted the build.

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

Expand to view the summary

Build stats

  • Duration: 68 min 21 sec

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@elasticmachine
Copy link
Collaborator

💔 Build Failed

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

  • Duration: 129 min 2 sec

Pipeline error 1

This error is likely related to the pipeline itself. Click here
and then you will see the error (either incorrect syntax or an invalid configuration).

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@elasticmachine
Copy link
Collaborator

❕ Build Aborted

Either there was a build timeout or someone aborted the build.

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

Expand to view the summary

Build stats

  • Duration: 10 min 42 sec

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@jeniawhite jeniawhite force-pushed the evgb-NormalizeInplace branch from c6a7426 to 6d06a1e Compare December 6, 2023 20:55
@elasticmachine
Copy link
Collaborator

❕ Build Aborted

Either there was a build timeout or someone aborted the build.

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

Expand to view the summary

Build stats

  • Duration: 64 min 17 sec

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@elasticmachine
Copy link
Collaborator

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

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

Expand to view the summary

Build stats

  • Start Time: 2023-12-06T20:56:19.200+0000

  • Duration: 101 min 12 sec

Test stats 🧪

Test Results
Failed 2
Passed 28205
Skipped 1998
Total 30205

Test errors 2

Expand to view the tests failures

Build&Test / libbeat-unitTest / TestConvertNestedMapStr – github.com/elastic/beats/v7/libbeat/common
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestConvertNestedMapStr
        event_test.go:140: 
            	Error Trace:	/var/lib/jenkins/workspace/PR-36044-12-3f87db58-61db-4d65-beba-64af2f7bdb0c/src/github.com/elastic/beats/libbeat/common/event_test.go:140
            	Error:      	Should be empty, but was [key=key2: error unsupported type=uintptr value=0x58 key=key3: error unsupported type=func() value=(func())(0x826da0)]
            	Test:       	TestConvertNestedMapStr
    --- FAIL: TestConvertNestedMapStr (0.00s)
     
    

Build&Test / libbeat-goIntegTest / TestConvertNestedMapStr – github.com/elastic/beats/v7/libbeat/common
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestConvertNestedMapStr
        event_test.go:140: 
            	Error Trace:	/var/lib/jenkins/workspace/PR-36044-12-54f105ea-9e16-416f-aebb-08a9d7a2ba1c/src/github.com/elastic/beats/libbeat/common/event_test.go:140
            	Error:      	Should be empty, but was [key=key2: error unsupported type=uintptr value=0x58 key=key3: error unsupported type=func() value=(func())(0x81c920)]
            	Test:       	TestConvertNestedMapStr
    --- FAIL: TestConvertNestedMapStr (0.00s)
     
    

Steps errors 8

Expand to view the steps failures

libbeat-unitTest - mage build unitTest
  • Took 12 min 38 sec . View more details here
  • Description: mage build unitTest
libbeat-unitTest - mage build unitTest
  • Took 9 min 20 sec . View more details here
  • Description: mage build unitTest
libbeat-unitTest - mage build unitTest
  • Took 9 min 18 sec . View more details here
  • Description: mage build unitTest
libbeat-goIntegTest - mage goIntegTest
  • Took 15 min 41 sec . View more details here
  • Description: mage goIntegTest
libbeat-goIntegTest - mage goIntegTest
  • Took 11 min 8 sec . View more details here
  • Description: mage goIntegTest
libbeat-goIntegTest - mage goIntegTest
  • Took 11 min 18 sec . View more details here
  • Description: mage goIntegTest
metricbeat-pythonIntegTest - mage pythonIntegTest
  • Took 34 min 11 sec . View more details here
  • Description: mage pythonIntegTest
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: Error 'hudson.AbortException: script returned exit code 1'

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@elasticmachine
Copy link
Collaborator

💚 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: 2023-12-06T22:31:21.575+0000

  • Duration: 131 min 7 sec

Test stats 🧪

Test Results
Failed 0
Passed 28658
Skipped 2015
Total 30673

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

rdner and others added 3 commits December 6, 2023 20:25
Now we can quickly compare performance metrics when we make changes to the
filestream implementation without running the whole Filebeat.
revert benchmarks

return errors and remove test case

check for no errors

fixing lint

fixing lint and tests

remove unused
@elasticmachine
Copy link
Collaborator

❕ Build Aborted

Either there was a build timeout or someone aborted the build.

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

Expand to view the summary

Build stats

  • Duration: 29 min 41 sec

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@elasticmachine
Copy link
Collaborator

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

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

Expand to view the summary

Build stats

  • Start Time: 2023-12-07T07:12:28.236+0000

  • Duration: 126 min 27 sec

Test stats 🧪

Test Results
Failed 0
Passed 20431
Skipped 1398
Total 21829

Steps errors 7

Expand to view the steps failures

Print Message
  • Took 0 min 0 sec . View more details here
  • Description: �[39;49m[INFO] Allocating a worker with the labels 'windows-2016'.�[0m
Print Message
  • Took 0 min 0 sec . View more details here
  • Description: �[39;49m[INFO] Allocating a worker with the labels 'windows-2016'.�[0m
Print Message
  • Took 0 min 0 sec . View more details here
  • Description: �[39;49m[INFO] Allocating a worker with the labels 'windows-2016'.�[0m
Print Message
  • Took 0 min 0 sec . View more details here
  • Description: �[39;49m[INFO] Allocating a worker with the labels 'windows-2016'.�[0m
Print Message
  • Took 0 min 0 sec . View more details here
  • Description: �[39;49m[INFO] Allocating a worker with the labels 'windows-2016'.�[0m
Print Message
  • Took 0 min 0 sec . View more details here
  • Description: �[39;49m[INFO] Allocating a worker with the labels 'windows-2019'.�[0m
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: untar: step failed with error null

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@elasticmachine
Copy link
Collaborator

💚 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

  • Duration: 135 min 46 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@@ -0,0 +1,175 @@
// Licensed to Elasticsearch B.V. under one or more contributor
Copy link
Member

Choose a reason for hiding this comment

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

I added this benchmark over these 3 PRs:

It seems like you don't have the latest version here, therefore it's marked as a new file.

I think you should update this file to the latest version from main and then add a case for normalisation and compare the benchmark results before and after your changes.

Copy link
Contributor

mergify bot commented Feb 12, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b evgb-NormalizeInplace upstream/evgb-NormalizeInplace
git merge upstream/main
git push upstream evgb-NormalizeInplace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify enhancement needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants