-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(serverstats): refactor serverstats to new interface COMPASS-7400 (
#5148) * chore(serverstats): refactor serverstats to new interface * chore(serverstats): add d.ts export
- Loading branch information
1 parent
4cf6958
commit 91f4a85
Showing
9 changed files
with
105 additions
and
81 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,59 @@ | ||
import { PerformanceComponent } from './components'; | ||
import { registerHadronPlugin } from 'hadron-app-registry'; | ||
import type { DataService } from 'mongodb-data-service'; | ||
import { dataServiceLocator } from 'mongodb-data-service/provider'; | ||
import { mongoDBInstanceLocator } from '@mongodb-js/compass-app-stores/provider'; | ||
import CurrentOpStore from './stores/current-op-store'; | ||
import ServerStatsStore from './stores/server-stats-graphs-store'; | ||
import TopStore from './stores/top-store'; | ||
|
||
const PerformancePlugin = registerHadronPlugin( | ||
{ | ||
name: 'Performance', | ||
component: PerformanceComponent, | ||
activate(_: unknown, { dataService, instance }) { | ||
CurrentOpStore.onActivated(dataService); | ||
ServerStatsStore.onActivated(dataService); | ||
TopStore.onActivated(dataService, instance); | ||
|
||
// TODO(COMPASS-7416): no stores or subscriptions are returned here, we'd | ||
// need to refactor the stores of this package | ||
return { | ||
store: {}, | ||
deactivate() { | ||
// noop | ||
}, | ||
}; | ||
}, | ||
}, | ||
{ | ||
dataService: dataServiceLocator as typeof dataServiceLocator< | ||
keyof DataService | ||
>, | ||
instance: mongoDBInstanceLocator, | ||
} | ||
); | ||
|
||
const InstanceTab = { | ||
name: 'Performance', | ||
component: PerformancePlugin, | ||
}; | ||
|
||
/** | ||
* Activate all the components in the RTSS package. | ||
*/ | ||
function activate() { | ||
// noop | ||
} | ||
|
||
/** | ||
* Deactivate all the components in the RTSS package. | ||
*/ | ||
function deactivate() { | ||
// noop | ||
} | ||
|
||
export default PerformancePlugin; | ||
export { activate, deactivate, InstanceTab }; | ||
export { default as d3 } from './d3'; | ||
export { default as metadata } from '../package.json'; |
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