fixing tracking metrics
Summary: - fixing dropped frames calculation - fixing plugin activation time Reviewed By: passy Differential Revision: D9301759 fbshipit-source-id: 872e4d2edcafdbc67668f3d0b713dfbf55f068f5
This commit is contained in:
committed by
Facebook Github Bot
parent
656044ce69
commit
eb316be4e4
@@ -108,7 +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.props.logger.trackTimeSince(`activePlugin-${ref.constructor.id}`);
|
||||||
this.plugin = ref;
|
this.plugin = ref;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ export default (store: Store, logger: Logger) => {
|
|||||||
) {
|
) {
|
||||||
const now = performance.now();
|
const now = performance.now();
|
||||||
requestAnimationFrame(() => droppedFrameDetection(now, isWindowFocused));
|
requestAnimationFrame(() => droppedFrameDetection(now, isWindowFocused));
|
||||||
if (isWindowFocused()) {
|
const dropped = Math.round((now - past) / (1000 / 60) - 1);
|
||||||
droppedFrames += Math.max(0, Math.round(now - past / (1000 / 60) - 1));
|
if (dropped > 0 && isWindowFocused()) {
|
||||||
|
droppedFrames += dropped;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user