grafana / explore-profiles

Explore Profiles is a native Grafana application designed to integrate seamlessly with Pyroscope, the open-source continuous profiling platform, providing a smooth, query-less experience for browsing and analyzing profiling data.
GNU Affero General Public License v3.0
17 stars 1 forks source link

refactor(*): Improve scene objects cohesion #82

Closed grafakus closed 1 month ago

grafakus commented 1 month ago

✨ Description

Related issue(s): is blocked by https://github.com/grafana/explore-profiles/pull/80 (should be merged after)

This PR pulls out specific Scene objects responsibilities out of the root SceneProfilesExplorer class. We do this in order to improve the cohesion of each Scene object responsible for a type of exploration. Eventually we hope the code will be easier to maintain and to reason about.

📖 Summary of the changes

There are 2 main changes:

  1. Each Scene object responsible for an exploration type tells SceneProfilesExplorer which variables and grid controls to render
  2. For events emitted as a result of a user click on a panel action, SceneProfilesExplorer now passes them to the Scene object constructor, which responsibility is to initialize properly the variables it uses

See diff tab for specific comments.

🧪 How to test?

github-actions[bot] commented 1 month ago

Unit test coverage

Lines Statements Branches Functions
Coverage: 12%
12.63% (470/3719) 9.98% (138/1382) 9.54% (108/1132)