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

Unified Diff: runtime/observatory/lib/src/elements/memory/graph.dart

Issue 2993003002: Avoid graph extending outside the drawing area. (Closed)
Patch Set: Created 3 years, 4 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/memory/graph.dart
diff --git a/runtime/observatory/lib/src/elements/memory/graph.dart b/runtime/observatory/lib/src/elements/memory/graph.dart
index 298527cdb4a060812cd2b45d864bcd299a09b422..a89ba43edf070b9f1ed8d2dc9d239294b62ffa9c 100644
--- a/runtime/observatory/lib/src/elements/memory/graph.dart
+++ b/runtime/observatory/lib/src/elements/memory/graph.dart
@@ -194,7 +194,7 @@ class MemoryGraphElement extends HtmlElement implements Renderable {
if (_running) return;
_running = true;
final now = new DateTime.now();
- final start = now.subtract(_window).subtract(_period);
+ final start = now.subtract(_window);
// The Service classes order isolates from the older to the newer
final isolates =
(await Future.wait(_vm.isolates.map(_isolates.get))).reversed.toList();
@@ -205,6 +205,13 @@ class MemoryGraphElement extends HtmlElement implements Renderable {
_isolateFreeSamples.removeAt(0);
}
+ if (_ts.first.isAfter(start)) {
+ _ts.insert(0, start);
+ _vmSamples.insert(0, _vmSamples.first);
+ _isolateUsedSamples.insert(0, _isolateUsedSamples.first);
+ _isolateFreeSamples.insert(0, _isolateFreeSamples.first);
+ }
+
if (_isolateIndex.length == 0) {
_selected = isolates.length * 2;
_onIsolateSelected.add(new IsolateSelectedEvent(isolates.last));
« 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