Skip to content

Commit

Permalink
Merge pull request google#92 from google/benvanik
Browse files Browse the repository at this point in the history
Fixing system event times.
  • Loading branch information
benvanik committed Dec 10, 2012
2 parents 2cc536a + d3f99fc commit cce4ed7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions injector/wtf-injector-chrome/manifest.json
Expand Up @@ -4,7 +4,7 @@
// These can be copy/pasted directly between them.
// ---------------------------------------------------------------------------
"manifest_version": 2,
"version": "0.0.23",
"version": "0.0.24",
"minimum_chrome_version": "21",
"offline_enabled": true,
"incognito": "split",
Expand All @@ -24,7 +24,7 @@
},
"page_action": {
"workaround": "https://code.google.com/p/chromium/issues/detail?id=86449"
},
},
"icons": {
},
//"homepage_url": "",
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "tracing-framework",
"version": "0.0.23",
"version": "0.0.24",
"description": "Web Tracing Framework instrumentation and analysis library.",
"keywords": [
"javascript",
Expand Down
6 changes: 5 additions & 1 deletion src/wtf/analysis/db/eventdatatable.js
Expand Up @@ -352,7 +352,11 @@ wtf.analysis.db.ScopeEventDataEntry.prototype.getUserTime = function() {
*/
wtf.analysis.db.ScopeEventDataEntry.prototype.getMeanTime = function() {
if (this.count) {
return this.userTime_ / this.count;
if (this.eventType.flags & wtf.data.EventFlag.SYSTEM_TIME) {
return this.totalTime_ / this.count;
} else {
return this.userTime_ / this.count;
}
} else {
return 0;
}
Expand Down
12 changes: 9 additions & 3 deletions src/wtf/app/ui/tracks/trackinfobar.js
Expand Up @@ -206,17 +206,23 @@ wtf.app.ui.tracks.TrackInfoBar.prototype.buildTableRow_ = function(
var content = '';
if (entry instanceof wtf.analysis.db.ScopeEventDataEntry) {
var totalTime = Math.round(entry.getTotalTime());
if (totalTime < 1) {
if (!totalTime) {
totalTime = '0';
} else if (totalTime < 1) {
totalTime = '<1';
}
totalTime += 'ms';
var userTime = Math.round(entry.getUserTime());
if (userTime < 1) {
if (!userTime) {
userTime = '0';
} else if (userTime < 1) {
userTime = '<1';
}
userTime += 'ms';
var meanTime = Math.round(entry.getMeanTime());
if (meanTime < 1) {
if (!meanTime) {
meanTime = '0';
} else if (meanTime < 1) {
meanTime = '<1';
}
meanTime += 'ms';
Expand Down

0 comments on commit cce4ed7

Please sign in to comment.