Skip to content

Conversation

@patrick-sko
Copy link
Owner

This PR also contains three different files (Instrumentation Mapping, Execution results, and the final JSON) which are examples of what the format looks like. This way you can look in greater detail at what the reporter parsed and generates in case we might want to change something.

I also added command line arguments to the reporter which is in this PR.

@patrick-sko patrick-sko changed the base branch from implementation_of_reporter_without_commandLineArgs to master August 24, 2020 16:27
* The instrumentation will send the report in a JSON format where the JSON is a dictionary of the
* encoded params to an object of the data collected. Initially this will just be the frequency.
*/
public static class ProfilingData {

Choose a reason for hiding this comment

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

Can we also make this AutoValue?

It might make the class definition slightly larger for now, but will be good if we need to update the class in the future.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'm not sure if I am not using AutoValue incorrectly, but marking this class as AutoValue will break JSON deserialization. This class is used to convert the executionResults.json file for reference.

Choose a reason for hiding this comment

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

Interesting, that's fine then.

Could you just add a short comment explaining why this can't be AutoValue?


abstract float percentOfBranchesExecuted();

abstract Map<String, List<ProfilingResult>> profilingDataPerFunction();

Choose a reason for hiding this comment

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

Consider using a MultiMap here

https://guava.dev/releases/23.0/api/docs/com/google/common/collect/Multimap.html

It's a cleaner abstraction than having the value type be a List

Copy link
Owner Author

Choose a reason for hiding this comment

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

Guava really does have a interface for everything.

Copy link
Owner Author

@patrick-sko patrick-sko Aug 25, 2020

Choose a reason for hiding this comment

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

As much as a like this interface, and have tried to make it work, it seems very difficult to use with JSON serialization. This field needs to be a Map of String keys to a list of ProfilingResult values, otherwise the Gson will not serialize properly. Any work around I believe will require changes to how Gson serializes data which I don't believe is worth it.

Choose a reason for hiding this comment

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

OK, sounds reasonable.

@emaxx-google
Copy link

Hello, is there any plan this can be merged into the Closure Compiler repo and becomes part of the compiler itself?
It's pretty cumbersome to use this separate pull request, and also the flow seems unmaintained.

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

Successfully merging this pull request may close these issues.

5 participants