| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 | 5 |
| 6 import 'dart:profiler'; | 6 import 'dart:profiler'; |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 | 8 |
| 9 testGauge1() { | 9 testGauge1() { |
| 10 var gauge = new Gauge('test', 'alpha bravo', 0.0, 100.0); | 10 var gauge = new Gauge('test', 'alpha bravo', 0.0, 100.0); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 Metrics.deregister(counter); | 92 Metrics.deregister(counter); |
| 93 Metrics.register(counter); | 93 Metrics.register(counter); |
| 94 var counter3 = new Counter('a.b.c.d', ''); | 94 var counter3 = new Counter('a.b.c.d', ''); |
| 95 Metrics.register(counter3); | 95 Metrics.register(counter3); |
| 96 } | 96 } |
| 97 | 97 |
| 98 testBadName() { | 98 testBadName() { |
| 99 Expect.throws(() { | 99 Expect.throws(() { |
| 100 var counter = new Counter('a.b/c', 'description'); | 100 var counter = new Counter('a.b/c', 'description'); |
| 101 }); | 101 }); |
| 102 Expect.throws(() { |
| 103 var counter = new Counter('vm', 'description'); |
| 104 }); |
| 102 } | 105 } |
| 103 | 106 |
| 104 main() { | 107 main() { |
| 105 testGauge1(); | 108 testGauge1(); |
| 106 testGauge2(); | 109 testGauge2(); |
| 107 testCounter(); | 110 testCounter(); |
| 108 testCustomCounter(); | 111 testCustomCounter(); |
| 109 testMetricNameCollision(); | 112 testMetricNameCollision(); |
| 110 testBadName(); | 113 testBadName(); |
| 111 } | 114 } |
| OLD | NEW |