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

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

Issue 1343253002: - Remove unused Counters class from isolate. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « runtime/vm/counters.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "vm/counters.h"
6
7 #include <string.h>
8 #include <map> // TODO(koda): Remove STL dependencies.
9
10 #include "platform/globals.h"
11 #include "vm/os.h"
12
13 namespace dart {
14
15 struct CStrLess {
16 bool operator()(const char* a, const char* b) const {
17 return strcmp(a, b) < 0;
18 }
19 };
20
21
22 Counters::~Counters() {
23 if (collision_) {
24 OS::PrintErr("Counters table collision; increase Counters::kSize.");
25 return;
26 }
27 typedef std::map<const char*, int64_t, CStrLess> TotalsMap;
28 TotalsMap totals;
29 for (int i = 0; i < kSize; ++i) {
30 const Counter& counter = counters_[i];
31 if (counter.name != NULL) {
32 totals[counter.name] += counter.value;
33 }
34 }
35 for (TotalsMap::iterator it = totals.begin(); it != totals.end(); ++it) {
36 OS::PrintErr("%s: %" Pd64 "\n", it->first, it->second);
37 }
38 }
39
40 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/counters.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698