-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from krassowski/custom-scenarios
Allow to add scenarios programmatically
- Loading branch information
Showing
8 changed files
with
186 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { Token } from '@lumino/coreutils'; | ||
import { JSONSchema7 } from 'json-schema'; | ||
|
||
/** | ||
* Scenario defining set of steps to carry out during benchmarking. | ||
*/ | ||
export interface IScenario { | ||
/** | ||
* The internal identifier, has to be unique. | ||
*/ | ||
id: string; | ||
|
||
/** | ||
* The name displayed to user. | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* The actual scenario execution. | ||
* | ||
* Note: any async calls made in the `run()` function should be awaited so | ||
* that the execution time measurements are accurate and to prevent calling | ||
* `cleanup()` too early. | ||
*/ | ||
run: () => Promise<void>; | ||
|
||
/** | ||
* Prepare scenario before running, called once for any given benchmark run. | ||
*/ | ||
setupSuite?: () => Promise<void>; | ||
|
||
/** | ||
* Clean up after scenario running, called once for any given benchmark run. | ||
*/ | ||
cleanupSuite?: () => Promise<void>; | ||
|
||
/** | ||
* Prepare for scenario repeat, called as many times as benchmark repeats. | ||
*/ | ||
setup?: () => Promise<void>; | ||
|
||
/** | ||
* Clean up after scenario, called as many times as benchmark repeats. | ||
*/ | ||
cleanup?: () => Promise<void>; | ||
|
||
/** | ||
* Configuration schema used to build the configuration form with rjsf. | ||
*/ | ||
configSchema?: JSONSchema7; | ||
|
||
/** | ||
* Callback receiving JSON object with user configuration choices. | ||
*/ | ||
setOptions?: (options: any) => void; | ||
} | ||
|
||
/** | ||
* The UIProfiler public API. | ||
*/ | ||
export interface IUIProfiler { | ||
/** | ||
* Add scenario to profiler. | ||
*/ | ||
addScenario(scenario: IScenario): void; | ||
} | ||
|
||
/** | ||
* The UIProfiler token. | ||
*/ | ||
export const IUIProfiler = new Token<IUIProfiler>( | ||
'@jupyterlab/ui-profiler:manager' | ||
); |
Oops, something went wrong.