#include "src/heap/cppgc/stats-collector.h"
#include <algorithm>
#include <atomic>
#include <cmath>
#include "src/base/atomicops.h"
#include "src/base/logging.h"
#include "src/base/platform/time.h"
#include "src/heap/cppgc/metric-recorder.h"
namespace cppgc {
namespace internal {
constexpr size_t StatsCollector::kAllocationThresholdBytes;
StatsCollector::StatsCollector(Platform* platform) : … { … }
void StatsCollector::RegisterObserver(AllocationObserver* observer) { … }
void StatsCollector::UnregisterObserver(AllocationObserver* observer) { … }
void StatsCollector::NotifyAllocation(size_t bytes) { … }
void StatsCollector::NotifyExplicitFree(size_t bytes) { … }
void StatsCollector::NotifySafePointForConservativeCollection() { … }
void StatsCollector::NotifySafePointForTesting() { … }
void StatsCollector::AllocatedObjectSizeSafepointImpl() { … }
StatsCollector::Event::Event() { … }
void StatsCollector::NotifyUnmarkingStarted(CollectionType collection_type) { … }
void StatsCollector::NotifyMarkingStarted(CollectionType collection_type,
MarkingType marking_type,
IsForcedGC is_forced_gc) { … }
void StatsCollector::NotifyMarkingCompleted(size_t marked_bytes) { … }
double StatsCollector::GetRecentAllocationSpeedInBytesPerMs() const { … }
namespace {
int64_t SumPhases(const MetricRecorder::GCCycle::Phases& phases) { … }
MetricRecorder::GCCycle GetCycleEventForMetricRecorder(
CollectionType type, StatsCollector::MarkingType marking_type,
StatsCollector::SweepingType sweeping_type, int64_t atomic_mark_us,
int64_t atomic_weak_us, int64_t atomic_compact_us, int64_t atomic_sweep_us,
int64_t incremental_mark_us, int64_t incremental_sweep_us,
int64_t concurrent_mark_us, int64_t concurrent_sweep_us,
int64_t objects_before_bytes, int64_t objects_after_bytes,
int64_t objects_freed_bytes, int64_t memory_before_bytes,
int64_t memory_after_bytes, int64_t memory_freed_bytes) { … }
}
void StatsCollector::NotifySweepingCompleted(SweepingType sweeping_type) { … }
size_t StatsCollector::allocated_memory_size() const { … }
size_t StatsCollector::allocated_object_size() const { … }
size_t StatsCollector::marked_bytes() const { … }
size_t StatsCollector::marked_bytes_on_current_cycle() const { … }
v8::base::TimeDelta StatsCollector::marking_time() const { … }
void StatsCollector::NotifyAllocatedMemory(int64_t size) { … }
void StatsCollector::NotifyFreedMemory(int64_t size) { … }
void StatsCollector::IncrementDiscardedMemory(size_t value) { … }
void StatsCollector::DecrementDiscardedMemory(size_t value) { … }
void StatsCollector::ResetDiscardedMemory() { … }
size_t StatsCollector::discarded_memory_size() const { … }
size_t StatsCollector::resident_memory_size() const { … }
void StatsCollector::RecordHistogramSample(ScopeId scope_id_,
v8::base::TimeDelta time) { … }
}
}