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'); |