| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/heap/gc-tracer.h" | 7 #include "src/heap/gc-tracer.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 } | 695 } |
| 696 | 696 |
| 697 | 697 |
| 698 size_t GCTracer::AllocationThroughputInBytesPerMillisecond( | 698 size_t GCTracer::AllocationThroughputInBytesPerMillisecond( |
| 699 double time_ms) const { | 699 double time_ms) const { |
| 700 return NewSpaceAllocationThroughputInBytesPerMillisecond(time_ms) + | 700 return NewSpaceAllocationThroughputInBytesPerMillisecond(time_ms) + |
| 701 OldGenerationAllocationThroughputInBytesPerMillisecond(time_ms); | 701 OldGenerationAllocationThroughputInBytesPerMillisecond(time_ms); |
| 702 } | 702 } |
| 703 | 703 |
| 704 | 704 |
| 705 size_t GCTracer::CurrentAllocationThroughputInBytesPerMillisecond() const { |
| 706 return AllocationThroughputInBytesPerMillisecond(kThroughputTimeFrameMs); |
| 707 } |
| 708 |
| 709 |
| 705 size_t GCTracer::CurrentOldGenerationAllocationThroughputInBytesPerMillisecond() | 710 size_t GCTracer::CurrentOldGenerationAllocationThroughputInBytesPerMillisecond() |
| 706 const { | 711 const { |
| 707 static const double kThroughputTimeFrame = 5000; | |
| 708 return OldGenerationAllocationThroughputInBytesPerMillisecond( | 712 return OldGenerationAllocationThroughputInBytesPerMillisecond( |
| 709 kThroughputTimeFrame); | 713 kThroughputTimeFrameMs); |
| 710 } | 714 } |
| 711 | 715 |
| 712 | 716 |
| 713 double GCTracer::ContextDisposalRateInMilliseconds() const { | 717 double GCTracer::ContextDisposalRateInMilliseconds() const { |
| 714 if (context_disposal_events_.size() < kRingBufferMaxSize) return 0.0; | 718 if (context_disposal_events_.size() < kRingBufferMaxSize) return 0.0; |
| 715 | 719 |
| 716 double begin = base::OS::TimeCurrentMillis(); | 720 double begin = base::OS::TimeCurrentMillis(); |
| 717 double end = 0.0; | 721 double end = 0.0; |
| 718 ContextDisposalEventBuffer::const_iterator iter = | 722 ContextDisposalEventBuffer::const_iterator iter = |
| 719 context_disposal_events_.begin(); | 723 context_disposal_events_.begin(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 741 | 745 |
| 742 | 746 |
| 743 bool GCTracer::SurvivalEventsRecorded() const { | 747 bool GCTracer::SurvivalEventsRecorded() const { |
| 744 return survival_events_.size() > 0; | 748 return survival_events_.size() > 0; |
| 745 } | 749 } |
| 746 | 750 |
| 747 | 751 |
| 748 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } | 752 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } |
| 749 } // namespace internal | 753 } // namespace internal |
| 750 } // namespace v8 | 754 } // namespace v8 |
| OLD | NEW |