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

Side by Side Diff: src/counters.cc

Issue 2557463003: [Tracing] Remove AppendLongInteger in TracedValue. (Closed)
Patch Set: Address alph's comment Created 4 years 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 | « no previous file | src/tracing/traced-value.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/counters.h" 5 #include "src/counters.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 std::vector<Entry> entries; 273 std::vector<Entry> entries;
274 }; 274 };
275 275
276 void RuntimeCallCounter::Reset() { 276 void RuntimeCallCounter::Reset() {
277 count_ = 0; 277 count_ = 0;
278 time_ = base::TimeDelta(); 278 time_ = base::TimeDelta();
279 } 279 }
280 280
281 void RuntimeCallCounter::Dump(v8::tracing::TracedValue* value) { 281 void RuntimeCallCounter::Dump(v8::tracing::TracedValue* value) {
282 value->BeginArray(name_); 282 value->BeginArray(name_);
283 value->AppendLongInteger(count_); 283 value->AppendDouble(count_);
284 value->AppendLongInteger(time_.InMicroseconds()); 284 value->AppendDouble(time_.InMicroseconds());
285 value->EndArray(); 285 value->EndArray();
286 } 286 }
287 287
288 void RuntimeCallCounter::Add(RuntimeCallCounter* other) { 288 void RuntimeCallCounter::Add(RuntimeCallCounter* other) {
289 count_ += other->count(); 289 count_ += other->count();
290 time_ += other->time(); 290 time_ += other->time();
291 } 291 }
292 292
293 void RuntimeCallTimer::Snapshot() { 293 void RuntimeCallTimer::Snapshot() {
294 base::TimeTicks now = Now(); 294 base::TimeTicks now = Now();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 RuntimeCallStats::counters) { 407 RuntimeCallStats::counters) {
408 RuntimeCallCounter* counter = &(this->*counter_id); 408 RuntimeCallCounter* counter = &(this->*counter_id);
409 if (counter->count() > 0) counter->Dump(value); 409 if (counter->count() > 0) counter->Dump(value);
410 } 410 }
411 411
412 in_use_ = false; 412 in_use_ = false;
413 } 413 }
414 414
415 } // namespace internal 415 } // namespace internal
416 } // namespace v8 416 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/tracing/traced-value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698