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