Track plugin activation time
Summary: Track the time from when the plugin is selected until its `init()` function finishes. Reviewed By: passy Differential Revision: D9239750 fbshipit-source-id: 569f236c9d58f70548f1ba6bf31a96047dcc8245
This commit is contained in:
committed by
Facebook Github Bot
parent
800302b433
commit
faf8afe9cd
@@ -108,6 +108,7 @@ class PluginContainer extends Component<Props, State> {
|
|||||||
if (ref && target) {
|
if (ref && target) {
|
||||||
activateMenuItems(ref);
|
activateMenuItems(ref);
|
||||||
ref._init();
|
ref._init();
|
||||||
|
this.props.logger.trackTimeSince(`activePlugin-${ref.id}`);
|
||||||
this.plugin = ref;
|
this.plugin = ref;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -156,12 +156,16 @@ export default function reducer(
|
|||||||
}
|
}
|
||||||
case 'SELECT_PLUGIN': {
|
case 'SELECT_PLUGIN': {
|
||||||
const {payload} = action;
|
const {payload} = action;
|
||||||
|
const {selectedPlugin} = payload;
|
||||||
|
if (selectedPlugin) {
|
||||||
|
performance.mark(`activePlugin-${selectedPlugin}`);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
...payload,
|
...payload,
|
||||||
userPreferredApp: payload.selectedApp,
|
userPreferredApp: payload.selectedApp,
|
||||||
userPreferredPlugin: payload.selectedPlugin,
|
userPreferredPlugin: selectedPlugin,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user