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

Unified Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 1809913002: Source profiling color total and self columns independently (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/script_inset.dart
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart
index 6528c8ddd6e7a49a9a702202d4fd924303ffa342..1b94f3837f25e9c73f6a81e062f9029af9c48032 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -386,15 +386,19 @@ class ScriptLineProfile {
return Utils.formatPercent(totalTicks, sampleCount);
}
- double _percent() {
+ double _percent(bool self) {
if (sampleCount == 0) {
return 0.0;
}
- return totalTicks / sampleCount;
+ if (self) {
+ return selfTicks / sampleCount;
+ } else {
+ return totalTicks / sampleCount;
+ }
}
- bool get isHot => _percent() > kHotThreshold;
- bool get isMedium => _percent() > kMediumThreshold;
+ bool isHot(bool self) => _percent(self) > kHotThreshold;
+ bool isMedium(bool self) => _percent(self) > kMediumThreshold;
}
/// Box with script source code in it.
@@ -1140,9 +1144,9 @@ class ScriptInsetElement extends ObservatoryElement {
e.text = lineProfile.formattedTotalTicks;
}
- if (lineProfile.isHot) {
+ if (lineProfile.isHot(self)) {
e.classes.add('hotProfile');
- } else if (lineProfile.isMedium) {
+ } else if (lineProfile.isMedium(self)) {
e.classes.add('mediumProfile');
} else {
e.classes.add('coldProfile');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698