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

Move the memory usage status bar item to the nbresuse repo #9363

Closed
jtpio opened this issue Nov 18, 2020 · 0 comments · Fixed by #9386
Closed

Move the memory usage status bar item to the nbresuse repo #9363

jtpio opened this issue Nov 18, 2020 · 0 comments · Fixed by #9386
Labels
pkg:statusbar status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Extensions

Comments

@jtpio
Copy link
Member

jtpio commented Nov 18, 2020

In #9349, we realize that it would be simpler for the memory usage status bar item to be moved to the nbresuse repo, and developed as a third-party extension.

This item currently lives in lab here:

/**
* A plugin providing memory usage statistics to the application.
*
* #### Notes
* This plugin will not work unless the memory usage server extension
* is installed.
*/
export const memoryUsageItem: JupyterFrontEndPlugin<void> = {
id: '@jupyterlab/statusbar-extension:memory-usage-status',
autoStart: true,
requires: [IStatusBar, ITranslator],
activate: (
app: JupyterFrontEnd,
statusBar: IStatusBar,
translator: ITranslator
) => {
const item = new MemoryUsage(translator);
statusBar.registerStatusItem(
'@jupyterlab/statusbar-extension:memory-usage-status',
{
item,
align: 'left',
rank: 2,
isActive: () => item.model!.metricsAvailable,
activeStateChanged: item.model!.stateChanged
}
);
}
};

This would make it easier for nbresuse to move independently from JupyterLab, and avoid syncing on both repos for major releases.

The extension can be developed as federated / pre-built extension, using the new distribution system with pip and conda:

https://jupyterlab.readthedocs.io/en/latest/developer/extension_dev.html#goals-of-the-federated-extension-system

Which means that the extension would be automatically installed on pip install nbresuse, and would be seamless to the users since they already have to perform this step anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg:statusbar status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Extensions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant