| 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 } | 675 } |
| 676 | 676 |
| 677 | 677 |
| 678 size_t GCTracer::AllocationThroughputInBytesPerMillisecond( | 678 size_t GCTracer::AllocationThroughputInBytesPerMillisecond( |
| 679 double time_ms) const { | 679 double time_ms) const { |
| 680 return NewSpaceAllocationThroughputInBytesPerMillisecond(time_ms) + | 680 return NewSpaceAllocationThroughputInBytesPerMillisecond(time_ms) + |
| 681 OldGenerationAllocationThroughputInBytesPerMillisecond(time_ms); | 681 OldGenerationAllocationThroughputInBytesPerMillisecond(time_ms); |
| 682 } | 682 } |
| 683 | 683 |
| 684 | 684 |
| 685 size_t GCTracer::CurrentAllocationThroughputInBytesPerMillisecond() const { |
| 686 return AllocationThroughputInBytesPerMillisecond(kThroughputTimeFrameMs); |
| 687 } |
| 688 |
| 689 |
| 685 size_t GCTracer::CurrentOldGenerationAllocationThroughputInBytesPerMillisecond() | 690 size_t GCTracer::CurrentOldGenerationAllocationThroughputInBytesPerMillisecond() |
| 686 const { | 691 const { |
| 687 static const double kThroughputTimeFrame = 5000; | |
| 688 return OldGenerationAllocationThroughputInBytesPerMillisecond( | 692 return OldGenerationAllocationThroughputInBytesPerMillisecond( |
| 689 kThroughputTimeFrame); | 693 kThroughputTimeFrameMs); |
| 690 } | 694 } |
| 691 | 695 |
| 692 | 696 |
| 693 double GCTracer::ContextDisposalRateInMilliseconds() const { | 697 double GCTracer::ContextDisposalRateInMilliseconds() const { |
| 694 if (context_disposal_events_.size() < kRingBufferMaxSize) return 0.0; | 698 if (context_disposal_events_.size() < kRingBufferMaxSize) return 0.0; |
| 695 | 699 |
| 696 double begin = base::OS::TimeCurrentMillis(); | 700 double begin = base::OS::TimeCurrentMillis(); |
| 697 double end = 0.0; | 701 double end = 0.0; |
| 698 ContextDisposalEventBuffer::const_iterator iter = | 702 ContextDisposalEventBuffer::const_iterator iter = |
| 699 context_disposal_events_.begin(); | 703 context_disposal_events_.begin(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 721 | 725 |
| 722 | 726 |
| 723 bool GCTracer::SurvivalEventsRecorded() const { | 727 bool GCTracer::SurvivalEventsRecorded() const { |
| 724 return survival_events_.size() > 0; | 728 return survival_events_.size() > 0; |
| 725 } | 729 } |
| 726 | 730 |
| 727 | 731 |
| 728 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } | 732 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } |
| 729 } // namespace internal | 733 } // namespace internal |
| 730 } // namespace v8 | 734 } // namespace v8 |
| OLD | NEW |