Commit 2ff3bbbc authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[api, heap] Add GC events to v8::metrics::Recorder

The naming follows the scheme outlined in bit.ly/v8-gc-stats-collection
and in the UMA document referenced from it.

Bug: chromium:1154636
Change-Id: I872520de06e62f58d771383fd87d8aa06386bf0d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2650213Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72364}
parent a54efa43
......@@ -10,6 +10,58 @@
namespace v8 {
namespace metrics {
struct GarbageCollectionPhases {
int64_t compact_wall_clock_duration_in_us = -1;
int64_t mark_wall_clock_duration_in_us = -1;
int64_t sweep_wall_clock_duration_in_us = -1;
int64_t weak_wall_clock_duration_in_us = -1;
};
struct GarbageCollectionSizes {
int64_t bytes_before = -1;
int64_t bytes_after = -1;
int64_t bytes_freed = -1;
};
struct GarbageCollectionFullCycle {
GarbageCollectionPhases total;
GarbageCollectionPhases total_cpp;
GarbageCollectionPhases main_thread;
GarbageCollectionPhases main_thread_cpp;
GarbageCollectionPhases main_thread_atomic;
GarbageCollectionPhases main_thread_atomic_cpp;
GarbageCollectionPhases main_thread_incremental;
GarbageCollectionPhases main_thread_incremental_cpp;
GarbageCollectionSizes objects;
GarbageCollectionSizes objects_cpp;
GarbageCollectionSizes memory;
GarbageCollectionSizes memory_cpp;
double collection_rate_in_percent;
double collection_rate_cpp_in_percent;
double efficiency_in_bytes_per_us;
double efficiency_cpp_in_bytes_per_us;
double main_thread_efficiency_in_bytes_per_us;
double main_thread_efficiency_cpp_in_bytes_per_us;
};
struct GarbageCollectionFullMainThreadIncrementalMark {
int64_t wall_clock_duration_in_us = -1;
int64_t cpp_wall_clock_duration_in_us = -1;
};
struct GarbageCollectionFullMainThreadIncrementalSweep {
int64_t wall_clock_duration_in_us = -1;
int64_t cpp_wall_clock_duration_in_us = -1;
};
struct GarbageCollectionYoungCycle {
int64_t total_wall_clock_duration_in_us = -1;
int64_t main_thread_wall_clock_duration_in_us = -1;
double collection_rate_in_percent;
double efficiency_in_bytes_per_us;
double main_thread_efficiency_in_bytes_per_us;
};
struct WasmModuleDecoded {
bool async = false;
bool streamed = false;
......@@ -48,10 +100,14 @@ struct WasmModulesPerIsolate {
size_t count = 0;
};
#define V8_MAIN_THREAD_METRICS_EVENTS(V) \
V(WasmModuleDecoded) \
V(WasmModuleCompiled) \
V(WasmModuleInstantiated) \
#define V8_MAIN_THREAD_METRICS_EVENTS(V) \
V(GarbageCollectionFullCycle) \
V(GarbageCollectionFullMainThreadIncrementalMark) \
V(GarbageCollectionFullMainThreadIncrementalSweep) \
V(GarbageCollectionYoungCycle) \
V(WasmModuleDecoded) \
V(WasmModuleCompiled) \
V(WasmModuleInstantiated) \
V(WasmModuleTieredUp)
#define V8_THREAD_SAFE_METRICS_EVENTS(V) V(WasmModulesPerIsolate)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment