V8 API Reference Guide for node.js v9.9.0
Public Member Functions | Static Public Member Functions | List of all members
v8::CpuProfiler Class Reference

#include <v8-profiler.h>

Public Member Functions

void Dispose ()
void SetSamplingInterval (int us)
void StartProfiling (Local< String > title, bool record_samples=false)
CpuProfileStopProfiling (Local< String > title)
void CollectSample ()
void SetIdle (bool is_idle)

Static Public Member Functions

static CpuProfilerNew (Isolate *isolate)

Detailed Description

Interface for controlling CPU profiling. Instance of the profiler can be created using v8::CpuProfiler::New method.

Member Function Documentation

void v8::CpuProfiler::CollectSample ( )

Force collection of a sample. Must be called on the VM thread. Recording the forced sample does not contribute to the aggregated profile statistics.

void v8::CpuProfiler::Dispose ( )

Disposes the CPU profiler object.

static CpuProfiler* v8::CpuProfiler::New ( Isolate isolate)

Creates a new CPU profiler for the |isolate|. The isolate must be initialized. The profiler object must be disposed after use by calling |Dispose| method.

void v8::CpuProfiler::SetIdle ( bool  is_idle)

Tells the profiler whether the embedder is idle.

void v8::CpuProfiler::SetSamplingInterval ( int  us)

Changes default CPU profiler sampling interval to the specified number of microseconds. Default interval is 1000us. This method must be called when there are no profiles being recorded.

void v8::CpuProfiler::StartProfiling ( Local< String title,
bool  record_samples = false 

Starts collecting CPU profile. Title may be an empty string. It is allowed to have several profiles being collected at once. Attempts to start collecting several profiles with the same title are silently ignored. While collecting a profile, functions from all security contexts are included in it. The token-based filtering is only performed when querying for a profile.

|record_samples| parameter controls whether individual samples should be recorded in addition to the aggregated tree.

CpuProfile* v8::CpuProfiler::StopProfiling ( Local< String title)

Stops collecting CPU profile with a given title and returns it. If the title given is empty, finishes the last profile started.

The documentation for this class was generated from the following file: