Change private diagnostic metadata properties to be public
Thank you for Meter! It looks wonderful.
I am curious though why the diagnostic type specific metadata properties (like totalCPUTime and totalSampledTime) are private instead of public. These private properties appear to be the most interesting bits of data on the metadata types, and making them public requires that consumers go through the jsonRepresentation to get them out. This is most problematic if consumers would like to log data in a different format from JSON and so need to deserialize and then extract the keys manually.
Would it be okay to make those properties public?
I'm so glad you like it! I've been using it a bunch myself, but really only for crash reporting.
Great question. The reason why it is weird is because the serialized version doesn't line up with the MetricKit API. I think these should be made public on the CPUExceptionDiagnostic to match how MXCPUExceptionDiagnostic works.
I just forgot to do that in all places. But, it definitely should be corrected. Just for reference, here's an example:
https://github.com/ChimeHQ/Meter/blob/6d39f09d2d0971e75e870c1dc85c2a407e99157e/Sources/Meter/DiagnosticPayload.swift#L228
I'll see if I can get to this.
I'm happy to submit a PR. If you would like to follow that pattern, should the metadata methods that expose the metadata types be hidden and all properties on the metadata type exposed as a convenience on the diagnostic payload type?