cppgc: Change histograms from ms to us

Bug: chromium:1056170
Change-Id: Iaa3cefc652657246fffe7998dd8faa9d008d9195
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2652496
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72370}
This commit is contained in:
Omer Katz 2021-01-27 16:41:52 +01:00 committed by Commit Bot
parent 7af731c93d
commit 37d24e5647
4 changed files with 71 additions and 71 deletions

View File

@ -21,14 +21,14 @@ class StatsCollector;
class MetricRecorder {
public:
struct CppGCCycleEndMetricSamples {
int64_t atomic_mark_ms;
int64_t atomic_weak_ms;
int64_t atomic_compact_ms;
int64_t atomic_sweep_ms;
int64_t incremental_mark_ms;
int64_t incremental_sweep_ms;
int64_t concurrent_mark_ms;
int64_t concurrent_sweep_ms;
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;
@ -39,11 +39,11 @@ class MetricRecorder {
};
struct CppGCIncrementalMarkMetricSample {
int64_t duration_ms;
int64_t duration_us;
};
struct CppGCIncrementalSweepMetricSample {
int64_t duration_ms;
int64_t duration_us;
};
virtual ~MetricRecorder() = default;

View File

@ -130,12 +130,12 @@ void StatsCollector::NotifySweepingCompleted() {
current_ = Event();
if (metric_recorder_) {
MetricRecorder::CppGCCycleEndMetricSamples event{
previous_.scope_data[kAtomicMark].InMilliseconds(),
previous_.scope_data[kAtomicWeak].InMilliseconds(),
previous_.scope_data[kAtomicCompact].InMilliseconds(),
previous_.scope_data[kAtomicSweep].InMilliseconds(),
previous_.scope_data[kIncrementalMark].InMilliseconds(),
previous_.scope_data[kIncrementalSweep].InMilliseconds(),
previous_.scope_data[kAtomicMark].InMicroseconds(),
previous_.scope_data[kAtomicWeak].InMicroseconds(),
previous_.scope_data[kAtomicCompact].InMicroseconds(),
previous_.scope_data[kAtomicSweep].InMicroseconds(),
previous_.scope_data[kIncrementalMark].InMicroseconds(),
previous_.scope_data[kIncrementalSweep].InMicroseconds(),
previous_.concurrent_scope_data[kConcurrentMark],
previous_.concurrent_scope_data[kConcurrentSweep],
previous_.object_size_before_sweep_bytes /* objects_before */,
@ -176,13 +176,13 @@ void StatsCollector::RecordHistogramSample(ScopeId scope_id_,
switch (scope_id_) {
case kIncrementalMark: {
MetricRecorder::CppGCIncrementalMarkMetricSample event{
time.InMilliseconds()};
time.InMicroseconds()};
metric_recorder_->AddMainThreadEvent(event);
break;
}
case kIncrementalSweep: {
MetricRecorder::CppGCIncrementalSweepMetricSample event{
time.InMilliseconds()};
time.InMicroseconds()};
metric_recorder_->AddMainThreadEvent(event);
break;
}

View File

@ -425,11 +425,11 @@ void StatsCollector::InternalScope<trace_category,
}
// scope_category == StatsCollector::ScopeContext::kConcurrentThread
using Atomic32 = v8::base::Atomic32;
const int64_t ms = time.InMicroseconds();
DCHECK(ms <= std::numeric_limits<Atomic32>::max());
const int64_t us = time.InMicroseconds();
DCHECK_LE(us, std::numeric_limits<Atomic32>::max());
v8::base::Relaxed_AtomicIncrement(
&stats_collector_->current_.concurrent_scope_data[scope_id_],
static_cast<Atomic32>(ms));
static_cast<Atomic32>(us));
}
} // namespace internal

View File

@ -86,7 +86,7 @@ TEST_F(MetricRecorderTest, IncrementalScopesReportedImmediately) {
MetricRecorderImpl::CppGCIncrementalMarkMetricSample_callcount);
EXPECT_LT(
0u,
MetricRecorderImpl::CppGCIncrementalMarkMetricSample_event.duration_ms);
MetricRecorderImpl::CppGCIncrementalMarkMetricSample_event.duration_us);
}
{
EXPECT_EQ(0u,
@ -100,7 +100,7 @@ TEST_F(MetricRecorderTest, IncrementalScopesReportedImmediately) {
EXPECT_EQ(1u,
MetricRecorderImpl::CppGCIncrementalSweepMetricSample_callcount);
EXPECT_LT(0u, MetricRecorderImpl::CppGCIncrementalSweepMetricSample_event
.duration_ms);
.duration_us);
}
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_callcount);
EndGC(0);
@ -152,20 +152,20 @@ TEST_F(MetricRecorderTest, CycleEndHistogramReportsValuesForAtomicScopes) {
EndGC(0);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_mark_ms);
.incremental_mark_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_sweep_ms);
.incremental_sweep_us);
}
{
StartGC();
@ -178,20 +178,20 @@ TEST_F(MetricRecorderTest, CycleEndHistogramReportsValuesForAtomicScopes) {
EndGC(0);
EXPECT_LT(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_mark_ms);
.incremental_mark_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_sweep_ms);
.incremental_sweep_us);
}
{
StartGC();
@ -204,20 +204,20 @@ TEST_F(MetricRecorderTest, CycleEndHistogramReportsValuesForAtomicScopes) {
EndGC(0);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_us);
EXPECT_LT(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_mark_ms);
.incremental_mark_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_sweep_ms);
.incremental_sweep_us);
}
{
StartGC();
@ -230,20 +230,20 @@ TEST_F(MetricRecorderTest, CycleEndHistogramReportsValuesForAtomicScopes) {
EndGC(0);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_us);
EXPECT_LT(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_mark_ms);
.incremental_mark_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_sweep_ms);
.incremental_sweep_us);
}
{
StartGC();
@ -256,20 +256,20 @@ TEST_F(MetricRecorderTest, CycleEndHistogramReportsValuesForAtomicScopes) {
EndGC(0);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_us);
EXPECT_LT(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_mark_ms);
.incremental_mark_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_sweep_ms);
.incremental_sweep_us);
}
{
StartGC();
@ -282,20 +282,20 @@ TEST_F(MetricRecorderTest, CycleEndHistogramReportsValuesForAtomicScopes) {
EndGC(0);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_us);
EXPECT_LT(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_mark_ms);
.incremental_mark_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_sweep_ms);
.incremental_sweep_us);
}
{
StartGC();
@ -308,20 +308,20 @@ TEST_F(MetricRecorderTest, CycleEndHistogramReportsValuesForAtomicScopes) {
EndGC(0);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_mark_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_weak_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_compact_us);
EXPECT_EQ(
0u,
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_ms);
MetricRecorderImpl::CppGCCycleEndMetricSamples_event.atomic_sweep_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_mark_ms);
.incremental_mark_us);
EXPECT_LT(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.incremental_sweep_ms);
.incremental_sweep_us);
}
}
@ -330,9 +330,9 @@ TEST_F(MetricRecorderTest, ConcurrentSamplesAreReported) {
StartGC();
EndGC(0);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.concurrent_mark_ms);
.concurrent_mark_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.concurrent_sweep_ms);
.concurrent_sweep_us);
}
{
StartGC();
@ -344,9 +344,9 @@ TEST_F(MetricRecorderTest, ConcurrentSamplesAreReported) {
}
EndGC(0);
EXPECT_LT(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.concurrent_mark_ms);
.concurrent_mark_us);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.concurrent_sweep_ms);
.concurrent_sweep_us);
}
{
StartGC();
@ -358,9 +358,9 @@ TEST_F(MetricRecorderTest, ConcurrentSamplesAreReported) {
}
EndGC(0);
EXPECT_EQ(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.concurrent_mark_ms);
.concurrent_mark_us);
EXPECT_LT(0u, MetricRecorderImpl::CppGCCycleEndMetricSamples_event
.concurrent_sweep_ms);
.concurrent_sweep_us);
}
}