N|Solid
Public Types | Static Public Member Functions | List of all members
node::nsolid::CpuProfiler Class Reference

class that allows to take CPU profiles from a specific JS thread. More...

#include <nsolid.h>

Public Types

using cpu_profiler_proxy_sig = void(*)(int, std::string, void *)
 

Static Public Member Functions

template<typename Cb , typename... Data>
static int TakeProfile (uint64_t thread_id, uint64_t duration, Cb &&cb, Data &&... data)
 allows taking a CPU profile from a specific JS thread for a period of time. Only 1 concurrent profile per thread can be taken. More...
 
static int StopProfile (uint64_t thread_id)
 stops an in-progress CPU profiling from a specific thread_id More...
 

Detailed Description

class that allows to take CPU profiles from a specific JS thread.

Member Function Documentation

◆ StopProfile()

static int node::nsolid::CpuProfiler::StopProfile ( uint64_t  thread_id)
static

stops an in-progress CPU profiling from a specific thread_id

Parameters
thread_id
Returns
NSOLID_E_SUCCESS in case of success or a different NSOLID_E_ error value otherwise.

◆ TakeProfile()

template<typename Cb , typename... Data>
static int node::nsolid::CpuProfiler::TakeProfile ( uint64_t  thread_id,
uint64_t  duration,
Cb &&  cb,
Data &&...  data 
)
static

allows taking a CPU profile from a specific JS thread for a period of time. Only 1 concurrent profile per thread can be taken.

Parameters
thread_idJS thread to take the profile from.
durationduration in milliseconds of the CPU profile after which the profile will be returned in the callback.
cbcallback function with the following signature: cb(int status, std::string json, ...Data)
datavariable number of arguments to be propagated to the callback.
Returns
NSOLID_E_SUCCESS in case of success or a different NSOLID_E_ error value otherwise.

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