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

Change private diagnostic metadata properties to be public #7

Open
amonshiz opened this issue Feb 2, 2023 · 2 comments
Open

Change private diagnostic metadata properties to be public #7

amonshiz opened this issue Feb 2, 2023 · 2 comments

Comments

@amonshiz
Copy link

amonshiz commented Feb 2, 2023

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?

@mattmassicotte
Copy link
Contributor

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:

public var terminationReason: String? {

I'll see if I can get to this.

@amonshiz
Copy link
Author

amonshiz commented Feb 2, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants