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 /// Instrument your code with counters, gauges, and more. | 5 part of dart.developer; |
6 library dart.profiler; | |
7 | |
8 import 'dart:convert'; | |
9 | 6 |
10 /// A UserTag can be used to group samples in the Observatory profiler. | 7 /// A UserTag can be used to group samples in the Observatory profiler. |
11 abstract class UserTag { | 8 abstract class UserTag { |
12 /// The maximum number of UserTag instances that can be created by a program. | 9 /// The maximum number of UserTag instances that can be created by a program. |
13 static const MAX_USER_TAGS = 64; | 10 static const MAX_USER_TAGS = 64; |
14 | 11 |
15 factory UserTag(String label) => new _FakeUserTag(label); | 12 factory UserTag(String label) => new _FakeUserTag(label); |
16 | 13 |
17 /// Label of [this]. | 14 /// Label of [this]. |
18 String get label; | 15 String get label; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 for (var metric in _metrics.values) { | 188 for (var metric in _metrics.values) { |
192 metrics.add(metric._toJSON()); | 189 metrics.add(metric._toJSON()); |
193 } | 190 } |
194 var map = { | 191 var map = { |
195 'type': 'MetricList', | 192 'type': 'MetricList', |
196 'metrics': metrics, | 193 'metrics': metrics, |
197 }; | 194 }; |
198 return JSON.encode(map); | 195 return JSON.encode(map); |
199 } | 196 } |
200 } | 197 } |
OLD | NEW |