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

Unified Diff: runtime/observatory/lib/src/service/object.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/lib/src/elements/metrics.html ('k') | runtime/observatory/test/contexts_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index b56048bb0509b0888ce26d7b231e5328f923b7ad..b22a887b4a3c2ae9bf37eac9c779e770783b82a4 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -1330,13 +1330,14 @@ class Isolate extends ServiceObjectOwner with Coverage {
final ObservableMap<String, ServiceMetric> dartMetrics =
new ObservableMap<String, ServiceMetric>();
- final ObservableMap<String, ServiceMetric> vmMetrics =
+ final ObservableMap<String, ServiceMetric> nativeMetrics =
new ObservableMap<String, ServiceMetric>();
Future<ObservableMap<String, ServiceMetric>> _refreshMetrics(
- String id,
+ String metricType,
ObservableMap<String, ServiceMetric> metricsMap) {
- return getDeprecated(id).then((result) {
+ return invokeRpc('getIsolateMetricList',
+ { 'type': metricType }).then((result) {
if (result is DartError) {
// TODO(turnidge): Handle this more gracefully.
Logger.root.severe(result.message);
@@ -1345,8 +1346,8 @@ class Isolate extends ServiceObjectOwner with Coverage {
// Clear metrics map.
metricsMap.clear();
// Repopulate metrics map.
- var members = result['members'];
- for (var metric in members) {
+ var metrics = result['metrics'];
+ for (var metric in metrics) {
metricsMap[metric.id] = metric;
}
return metricsMap;
@@ -1354,15 +1355,15 @@ class Isolate extends ServiceObjectOwner with Coverage {
}
Future<ObservableMap<String, ServiceMetric>> refreshDartMetrics() {
- return _refreshMetrics('metrics', dartMetrics);
+ return _refreshMetrics('Dart', dartMetrics);
}
- Future<ObservableMap<String, ServiceMetric>> refreshVMMetrics() {
- return _refreshMetrics('metrics/vm', vmMetrics);
+ Future<ObservableMap<String, ServiceMetric>> refreshNativeMetrics() {
+ return _refreshMetrics('Native', nativeMetrics);
}
Future refreshMetrics() {
- return refreshDartMetrics().then((_) => refreshVMMetrics());
+ return Future.wait([refreshDartMetrics(), refreshNativeMetrics()]);
}
String toString() => "Isolate($_id)";
@@ -2822,8 +2823,8 @@ class ServiceMetric extends ServiceObject {
}
Future<ObservableMap> _fetchDirect() {
- // TODO(johnmmccutchan): Make this use json rpc.
- return vm._getAsMapDeprecated(link);
+ assert(owner is Isolate);
+ return isolate.invokeRpcNoUpgrade('getIsolateMetric', { 'metricId': id });
}
« no previous file with comments | « runtime/observatory/lib/src/elements/metrics.html ('k') | runtime/observatory/test/contexts_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698