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

Separate profiler out of the user interface #46

Merged
merged 3 commits into from
Apr 16, 2023

Conversation

krassowski
Copy link
Member

@krassowski krassowski commented Apr 8, 2023

Addresses #45

This allows downstream to run benchmarks programatically, including via playwright if jupyterlab app is exposed.

Code changes:

  • the main public API entry point, IUIProfiler was extended to offer the following methods and properties:
    interface IUIProfiler {
      addScenario(scenario: IScenario): void;
      runBenchmark<T extends IOutcome = IOutcome>(
        scenario: {
          id: string;
          options: JSONObject;
        },
        benchmark: {
          id: string;
          options: JSONObject;
        }
      ): Promise<IBenchmarkResult<T>>;
      readonly scenarioAdded: ISignal<IUIProfiler, IScenario>;
      abortBenchmark(): void;
      readonly progress: ISignal<IUIProfiler, IProgress>;
      readonly benchmarks: IBenchmark[];
      readonly scenarios: IScenario[];
    }
  • new plugin @jupyterlab/ui-profiler:user-interface was added which relies on IUIProfiler provided by @jupyterlab/ui-profiler:plugin
  • all interfaces required for core profiler were moved to tokens.ts and are now exported as public API members
  • the user interface react widget was renamed from UIProfiler to UIProfilerWidget
  • the IUIProfiler is now implemented in new UIProfiler class
  • IBenchmarkResultBase, IBenchmarkData, and type BenchmarkResult were merged into a single simplified IBenchmarkResult
    • IOutcome is now stored in IBenchmarkResult under .outcome field rather than (confusingly) .result as before; this is a soft deprecation, result loader supports the old format for now.

@krassowski krassowski added the enhancement New feature or request label Apr 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2023

Binder 👈 Launch a Binder on branch krassowski/ui-profiler/separate-user-interface

@krassowski
Copy link
Member Author

There is a trade-off in runBenchmark() definition which currently does not have strict types (but does not require retrieval of specific scenarios/benchmarks directly); the alternative would for the downstream user to provide the scenario and benchmark objects with pre-set options.

@krassowski krassowski merged commit 3c4d2c8 into jupyterlab:main Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant