Skip to content

remove mock data from the performance page #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/performance/performance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class PerformanceScreen extends Screen {
serviceInfo.service
.getCpuProfile(_isolateId, 'UserVM')
.then((CpuProfile profile) async {
// TODO:
// TODO(devoncarew):
print(profile);

final _CalcProfile calc = new _CalcProfile(profile);
Expand Down Expand Up @@ -138,7 +138,7 @@ class PerformanceScreen extends Screen {
perfTable.setRows(<PerfData>[]);

perfTable.onSelect.listen((PerfData data) {
// TODO:
// TODO(devoncarew):
print(data);
});

Expand Down Expand Up @@ -252,8 +252,6 @@ class CpuTracker {
static const Duration kMaxGraphTime = Duration(minutes: 1);
static const Duration kUpdateDelay = Duration(seconds: 1);

static final math.Random rnd = new math.Random();

VmService service;
Timer _pollingTimer;
final StreamController<Null> _changeController =
Expand All @@ -275,8 +273,7 @@ class CpuTracker {
return;
}

final int sample = (_lastValue ?? 50) + rnd.nextInt(20) - 10;
_addSample(sample.clamp(0, 100));
// TODO(devoncarew): Poll the VM for the CPU load.

_pollingTimer = new Timer(kUpdateDelay, _pollCpu);
}
Expand All @@ -288,6 +285,7 @@ class CpuTracker {

int get _lastValue => samples.isEmpty ? null : samples.last;

// ignore: unused_element
void _addSample(int sample) {
samples.add(sample);

Expand Down