Move pkg/jsonlog to be a subpackage of the single consumer#34946
Move pkg/jsonlog to be a subpackage of the single consumer#34946vdemeester merged 6 commits intomoby:masterfrom
Conversation
3619bfc to
face2f7
Compare
|
It would be nice to reconcile this with ffjson. |
I agree, but I think we need to get it setup with a |
|
@dnephin: Can you provide benchmark numbers for memory allocations done before and after these changes, please? |
pkg/jsonlog/jsonlogbytes.go
Outdated
There was a problem hiding this comment.
We are using that one on the client side right ? This might break a bunch of user of this pkg right ?
There was a problem hiding this comment.
This struct is not used by the cli. The cli is only using a constant, and is made forward compatible here: docker/cli#551
It might break users of this pkg, but that is unfortunately necessary. These packages were not maintained properly and developed really bad interfaces which need to be fixed. We're going to be breaking everyone with #32989 anyway, and I think this can be seen as cleanup work necessary for #32989.
The godoc (https://godoc.org/github.com/moby/moby/pkg/jsonlog) doesn't show any consumers of this package. I'm not sure how reliable that is, but it seems to work for other packages.
|
Looking at this again, I don't think |
Signed-off-by: Daniel Nephin <[email protected]>
Signed-off-by: Daniel Nephin <[email protected]>
Signed-off-by: Daniel Nephin <[email protected]>
Signed-off-by: Daniel Nephin <[email protected]>
Signed-off-by: Daniel Nephin <[email protected]>
Signed-off-by: Daniel Nephin <[email protected]>
face2f7 to
035604c
Compare
I found some benchmarks in This is the first go benchmark I've written, so let me know if you see anything that looks off. There were some logical errors in what exited before (wrong number of bytes because 1) it was using a different struct to calculate bytes, and 2) it was doing extra iterations not accounted for by |
|
I removed some more unused code |
Fixes moby#19803 Updated the json-logger to utilize the common log option 'tag' that can define container/image information to include as part of logging. When the 'tag' log option is not included, there is no change to the log content via the json-logger. When the 'tag' log option is included, the tag will be parsed as a template and the result will be stored within each log entry as the attribute 'tag'. Update: Removing test added to integration_cli as those have been deprecated. Update: Using proper test calls (require and assert) in jsonfilelog_test.go based on review. Update: Added new unit test configs for logs with tag. Updated unit test error checking. Update: Cleanup check in jsonlogbytes_test.go to match pending changes in PR moby#34946. Update: Merging to correct conflicts from PR moby#34946. Signed-off-by: bonczj <[email protected]>
|
@dnephin: Thank you. I'm worried about regressions related to memory allocations in this code. We've had some unpleasant issues related to this in the past. It's good to see allocations remain pretty much the same. |
Fixes moby#19803 Updated the json-logger to utilize the common log option 'tag' that can define container/image information to include as part of logging. When the 'tag' log option is not included, there is no change to the log content via the json-logger. When the 'tag' log option is included, the tag will be parsed as a template and the result will be stored within each log entry as the attribute 'tag'. Update: Removing test added to integration_cli as those have been deprecated. Update: Using proper test calls (require and assert) in jsonfilelog_test.go based on review. Update: Added new unit test configs for logs with tag. Updated unit test error checking. Update: Cleanup check in jsonlogbytes_test.go to match pending changes in PR moby#34946. Update: Merging to correct conflicts from PR moby#34946. Signed-off-by: bonczj <[email protected]>
Remove some unused code
Un-export some code that shouldn't be exported
Cleanup test cases
Move a constant to a more appropriate module
Move the pkg/jsonlog to a subpackage of jsonfilelog
/pkg#32989