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

Side by Side Diff: runtime/observatory/test/native_metrics_test.dart

Issue 886353006: Port metrics to RPC (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
OLDNEW
(Empty)
1 import 'package:observatory/service_io.dart';
2 import 'package:unittest/unittest.dart';
3 import 'test_helper.dart';
4
5 import 'dart:profiler';
6
7 void script() {
8 var counter = new Counter('a.b.c', 'description');
9 Metrics.register(counter);
10 counter.value = 1234.5;
11 }
12
13 var tests = [
14
15 (Isolate isolate) =>
16 isolate.refreshNativeMetrics().then((Map metrics) {
17 expect(metrics.length, greaterThan(1));
18 expect(metrics.length, greaterThan(1));
19 var foundOldHeapCapacity = metrics.values.any((m) =>
20 m.name == 'heap.old.capacity');
21 expect(foundOldHeapCapacity, equals(true));
22 }),
23
24 (Isolate isolate) =>
25 isolate.invokeRpc('getIsolateMetric',
26 { 'metricId': 'metrics/native/heap.old.used' })
27 .then((ServiceMetric counter) {
28 expect(counter.type, equals('Counter'));
29 expect(counter.name, equals('heap.old.used'));
30 }),
31
32 (Isolate isolate) =>
33 isolate.invokeRpc('getIsolateMetric',
34 { 'metricId': 'metrics/native/doesnotexist' })
35 .then((DartError err) {
36 expect(err is DartError, isTrue);
37 }),
38
39 ];
40
41 main(args) => runIsolateTests(args, tests, testeeBefore: script);
OLDNEW
« no previous file with comments | « runtime/observatory/test/mirror_references_test.dart ('k') | runtime/observatory/test/string_escaping_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698