Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: Source/devtools/front_end/CPUProfileView.js

Issue 23924003: Support submillisecond times on FlameChart (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/FlameChart.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 function totalHitCount(node) { 568 function totalHitCount(node) {
569 var result = node.hitCount; 569 var result = node.hitCount;
570 for (var i = 0; i < node.children.length; i++) 570 for (var i = 0; i < node.children.length; i++)
571 result += totalHitCount(node.children[i]); 571 result += totalHitCount(node.children[i]);
572 return result; 572 return result;
573 } 573 }
574 profile.totalHitCount = totalHitCount(profile.head); 574 profile.totalHitCount = totalHitCount(profile.head);
575 575
576 var durationMs = 1000 * profile.endTime - 1000 * profile.startTime; 576 var durationMs = 1000 * profile.endTime - 1000 * profile.startTime;
577 var samplingRate = profile.totalHitCount / durationMs; 577 var samplingRate = profile.totalHitCount / durationMs;
578 this.samplesPerMs = samplingRate;
578 579
579 function calculateTimesForNode(node) { 580 function calculateTimesForNode(node) {
580 node.selfTime = node.hitCount * samplingRate; 581 node.selfTime = node.hitCount * samplingRate;
581 var totalTime = node.selfTime; 582 var totalTime = node.selfTime;
582 for (var i = 0; i < node.children.length; i++) 583 for (var i = 0; i < node.children.length; i++)
583 totalTime += calculateTimesForNode(node.children[i]); 584 totalTime += calculateTimesForNode(node.children[i]);
584 node.totalTime = totalTime; 585 node.totalTime = totalTime;
585 return totalTime; 586 return totalTime;
586 } 587 }
587 calculateTimesForNode(profile.head); 588 calculateTimesForNode(profile.head);
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 this.title = file.name; 926 this.title = file.name;
926 this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026"); 927 this.sidebarElement.subtitle = WebInspector.UIString("Loading\u2026");
927 this.sidebarElement.wait = true; 928 this.sidebarElement.wait = true;
928 929
929 var fileReader = new WebInspector.ChunkedFileReader(file, 10000000, this ); 930 var fileReader = new WebInspector.ChunkedFileReader(file, 10000000, this );
930 fileReader.start(this); 931 fileReader.start(this);
931 }, 932 },
932 933
933 __proto__: WebInspector.ProfileHeader.prototype 934 __proto__: WebInspector.ProfileHeader.prototype
934 } 935 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/FlameChart.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698