Fix PerformanceLogger clearing unfinished events

Reviewed By: alexeylang

Differential Revision: D4749516

fbshipit-source-id: 348f1cf51c01b39a410be8b39598e8e98cd52d55
This commit is contained in:
Pieter De Baets 2017-03-22 05:36:40 -07:00 committed by Facebook Github Bot
parent 0ea1ea5fb7
commit 005fbe6aa4

View File

@ -98,6 +98,15 @@ var PerformanceLogger = {
extras = {}; extras = {};
}, },
clearCompleted() {
for (var key in timespans) {
if (timespans[key].totalTime) {
delete timespans[key];
}
}
extras = {};
},
clearExceptTimespans(keys) { clearExceptTimespans(keys) {
timespans = Object.keys(timespans).reduce(function(previous, key) { timespans = Object.keys(timespans).reduce(function(previous, key) {
if (keys.indexOf(key) !== -1) { if (keys.indexOf(key) !== -1) {