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

Side by Side Diff: runtime/vm/metrics_test.cc

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
« no previous file with comments | « runtime/vm/metrics.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "platform/assert.h" 5 #include "platform/assert.h"
6 6
7 #include "vm/dart_api_impl.h" 7 #include "vm/dart_api_impl.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/json_stream.h" 10 #include "vm/json_stream.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // value is still the default value. 48 // value is still the default value.
49 EXPECT_EQ(0, metric.value()); 49 EXPECT_EQ(0, metric.value());
50 // Call LeakyValue to confirm that Value returns constant 99. 50 // Call LeakyValue to confirm that Value returns constant 99.
51 EXPECT_EQ(99, metric.LeakyValue()); 51 EXPECT_EQ(99, metric.LeakyValue());
52 52
53 // Serialize to JSON. 53 // Serialize to JSON.
54 JSONStream js; 54 JSONStream js;
55 metric.PrintJSON(&js); 55 metric.PrintJSON(&js);
56 const char* json = js.ToCString(); 56 const char* json = js.ToCString();
57 EXPECT_STREQ("{\"type\":\"Counter\",\"name\":\"a.b.c\",\"description\":" 57 EXPECT_STREQ("{\"type\":\"Counter\",\"name\":\"a.b.c\",\"description\":"
58 "\"foobar\",\"unit\":\"byte\",\"id\":\"metrics\\/vm\\/a.b.c\"" 58 "\"foobar\",\"unit\":\"byte\","
59 "\"id\":\"metrics\\/native\\/a.b.c\""
59 ",\"value\":99.000000}", json); 60 ",\"value\":99.000000}", json);
60 } 61 }
61 62
62 } // namespace dart 63 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/metrics.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698