-
Notifications
You must be signed in to change notification settings - Fork 29
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
3 changes/fixes around how tuples are output by the replayer. #513
Conversation
Copy the bytes into the tuple output rather than try to use the array (which could be very big and full of padded zeros). Don't use a json layout for log4j output - that cases the tuples to be escaped. Instead, just output the json-coded contents + a newline. Fix the humanReadables script to work with the above change. Signed-off-by: Greg Schohn <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #513 +/- ##
============================================
+ Coverage 76.71% 76.93% +0.21%
- Complexity 1385 1388 +3
============================================
Files 158 158
Lines 6086 6105 +19
Branches 532 532
============================================
+ Hits 4669 4697 +28
Misses 1059 1059
+ Partials 358 349 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Very happy to see this fix
@@ -156,7 +156,7 @@ public void testOutputterForGet() throws IOException { | |||
" \"Status-Code\": 200,\n" + | |||
" \"Reason-Phrase\": \"OK\",\n" + | |||
" \"response_time_ms\": 0,\n" + | |||
" \"body\": \"SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LXRyYW5zZmVyLWVuY29kaW5nOiBjaHVua2VkDQpEYXRlOiBUaHUsIDA4IEp1biAyMDIzIDIzOjA2OjIzIEdNVA0KVHJhbnNmZXItZW5jb2Rpbmc6IGNodW5rZWQNCkNvbnRlbnQtdHlwZTogdGV4dC9wbGFpbg0KRnVudGltZTogY2hlY2tJdCENCg0KMWUNCkkgc2hvdWxkIGJlIGRlY3J5cHRlZCB0ZXN0ZXIhCg0KMA0KDQo=\",\n" + | |||
" \"body\": \"SSBzaG91bGQgYmUgZGVjcnlwdGVkIHRlc3RlciEK\",\n" + |
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 was hoping there was funny message encoded ◡̈
@@ -156,7 +156,7 @@ public void testOutputterForGet() throws IOException { | |||
" \"Status-Code\": 200,\n" + | |||
" \"Reason-Phrase\": \"OK\",\n" + | |||
" \"response_time_ms\": 0,\n" + | |||
" \"body\": \"SFRUUC8xLjEgMjAwIE9LDQpDb250ZW50LXRyYW5zZmVyLWVuY29kaW5nOiBjaHVua2VkDQpEYXRlOiBUaHUsIDA4IEp1biAyMDIzIDIzOjA2OjIzIEdNVA0KVHJhbnNmZXItZW5jb2Rpbmc6IGNodW5rZWQNCkNvbnRlbnQtdHlwZTogdGV4dC9wbGFpbg0KRnVudGltZTogY2hlY2tJdCENCg0KMWUNCkkgc2hvdWxkIGJlIGRlY3J5cHRlZCB0ZXN0ZXIhCg0KMA0KDQo=\",\n" + | |||
" \"body\": \"SSBzaG91bGQgYmUgZGVjcnlwdGVkIHRlc3RlciEK\",\n" + |
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 was hoping there was funny message encoded ◡̈
Was human readable script tested? |
Yes, the script was tested against a simple run. There still aren't unit tests, so I'm not sure exactly what the behavior should be. |
Simplify and fix the json output of the 'tuples' that the replayer emits. No longer wrap the tuples within a log4j json record, just shoot it straight out, followed by a newline. Furthermore, the bodies often had many null values within them. That's been fixed by copying just the readable bytes rather than taking the whole byte array.
Description
Issues Resolved
#511
https://opensearch.atlassian.net/browse/MIGRATIONS-1510
Testing
Updated unit tests. Ran the docker solution and a standalone replayer with an input stream.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.