// Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_METRICS_H_ #define V8_METRICS_H_ #include <stddef.h> #include <stdint.h> #include <vector> #include "v8-internal.h" // NOLINT(build/include_directory) #include "v8-local-handle.h" // NOLINT(build/include_directory) #include "v8config.h" // NOLINT(build/include_directory) namespace v8 { class Context; class Isolate; namespace metrics { struct GarbageCollectionPhases { … }; struct GarbageCollectionSizes { … }; struct GarbageCollectionFullCycle { … }; struct GarbageCollectionFullMainThreadIncrementalMark { … }; struct GarbageCollectionFullMainThreadIncrementalSweep { … }; template <typename EventType> struct GarbageCollectionBatchedEvents { … }; GarbageCollectionFullMainThreadBatchedIncrementalMark; GarbageCollectionFullMainThreadBatchedIncrementalSweep; struct GarbageCollectionYoungCycle { … }; struct WasmModuleDecoded { … }; struct WasmModuleCompiled { … }; struct WasmModuleInstantiated { … }; struct WasmModulesPerIsolate { … }; /** * This class serves as a base class for recording event-based metrics in V8. * There a two kinds of metrics, those which are expected to be thread-safe and * whose implementation is required to fulfill this requirement and those whose * implementation does not have that requirement and only needs to be * executable on the main thread. If such an event is triggered from a * background thread, it will be delayed and executed by the foreground task * runner. * * The embedder is expected to call v8::Isolate::SetMetricsRecorder() * providing its implementation and have the virtual methods overwritten * for the events it cares about. */ class V8_EXPORT Recorder { … } … }; /** * Experimental API intended for the LongTasks UKM (crbug.com/1173527). * The Reset() method should be called at the start of a potential * long task. The Get() method returns durations of V8 work that * happened during the task. * * This API is experimental and may be removed/changed in the future. */ struct V8_EXPORT LongTaskStats { … }; } // namespace metrics } // namespace v8 #endif // V8_METRICS_H_