#include "src/heap/cppgc/metric-recorder.h"
#include "src/heap/cppgc/stats-collector.h"
#include "test/unittests/heap/cppgc/tests.h"
namespace cppgc {
namespace internal {
namespace {
class MetricRecorderImpl final : public MetricRecorder { … };
size_t MetricRecorderImpl::GCCycle_callcount = …;
MetricRecorderImpl::GCCycle MetricRecorderImpl::GCCycle_event;
size_t MetricRecorderImpl::MainThreadIncrementalMark_callcount = …;
MetricRecorderImpl::MainThreadIncrementalMark
MetricRecorderImpl::MainThreadIncrementalMark_event;
size_t MetricRecorderImpl::MainThreadIncrementalSweep_callcount = …;
MetricRecorderImpl::MainThreadIncrementalSweep
MetricRecorderImpl::MainThreadIncrementalSweep_event;
class MetricRecorderTest : public testing::TestWithHeap { … };
}
TEST_F(MetricRecorderTest, IncrementalScopesReportedImmediately) { … }
TEST_F(MetricRecorderTest, NonIncrementalScopesNotReportedImmediately) { … }
TEST_F(MetricRecorderTest, CycleEndMetricsReportedOnGcEnd) { … }
TEST_F(MetricRecorderTest, CycleEndHistogramReportsCorrectValues) { … }
TEST_F(MetricRecorderTest, ObjectSizeMetricsNoAllocations) { … }
TEST_F(MetricRecorderTest, ObjectSizeMetricsWithAllocations) { … }
}
}