N|Solid
Classes | Enumerations | Functions
node::nsolid Namespace Reference

nsolid namespace More...

Classes

class  CpuProfiler
 class that allows to take CPU profiles from a specific JS thread. More...
 
class  MetricsStream
 Class to retrieve a stream of some thread-specific metrics. More...
 
class  ProcessMetrics
 Class that allows to retrieve process-wide metrics. More...
 
class  Snapshot
 class that allows taking heap snapshots from a specific JS thread. More...
 
class  ThreadMetrics
 Class that allows to retrieve thread-specific metrics from a process. More...
 

Enumerations

enum  NSolidErr {
  NSOLID_E_SUCCESS = 0, NSOLID_E_NOT_LICENSED = 1, NSOLID_E_UV_E2BIG = UV_E2BIG, NSOLID_E_UV_EACCES = UV_EACCES,
  NSOLID_E_UV_EADDRINUSE = UV_EADDRINUSE, NSOLID_E_UV_EADDRNOTAVAIL = UV_EADDRNOTAVAIL, NSOLID_E_UV_EAFNOSUPPORT = UV_EAFNOSUPPORT, NSOLID_E_UV_EAGAIN = UV_EAGAIN,
  NSOLID_E_UV_EAI_ADDRFAMILY = UV_EAI_ADDRFAMILY, NSOLID_E_UV_EAI_AGAIN = UV_EAI_AGAIN, NSOLID_E_UV_EAI_BADFLAGS = UV_EAI_BADFLAGS, NSOLID_E_UV_EAI_BADHINTS = UV_EAI_BADHINTS,
  NSOLID_E_UV_EAI_CANCELED = UV_EAI_CANCELED, NSOLID_E_UV_EAI_FAIL = UV_EAI_FAIL, NSOLID_E_UV_EAI_FAMILY = UV_EAI_FAMILY, NSOLID_E_UV_EAI_MEMORY = UV_EAI_MEMORY,
  NSOLID_E_UV_EAI_NODATA = UV_EAI_NODATA, NSOLID_E_UV_EAI_NONAME = UV_EAI_NONAME, NSOLID_E_UV_EAI_OVERFLOW = UV_EAI_OVERFLOW, NSOLID_E_UV_EAI_PROTOCOL = UV_EAI_PROTOCOL,
  NSOLID_E_UV_EAI_SERVICE = UV_EAI_SERVICE, NSOLID_E_UV_EAI_SOCKTYPE = UV_EAI_SOCKTYPE, NSOLID_E_UV_EALREADY = UV_EALREADY, NSOLID_E_UV_EBADF = UV_EBADF,
  NSOLID_E_UV_EBUSY = UV_EBUSY, NSOLID_E_UV_ECANCELED = UV_ECANCELED, NSOLID_E_UV_ECHARSET = UV_ECHARSET, NSOLID_E_UV_ECONNABORTED = UV_ECONNABORTED,
  NSOLID_E_UV_ECONNREFUSED = UV_ECONNREFUSED, NSOLID_E_UV_ECONNRESET = UV_ECONNRESET, NSOLID_E_UV_EDESTADDRREQ = UV_EDESTADDRREQ, NSOLID_E_UV_EEXIST = UV_EEXIST,
  NSOLID_E_UV_EFAULT = UV_EFAULT, NSOLID_E_UV_EFBIG = UV_EFBIG, NSOLID_E_UV_EHOSTUNREACH = UV_EHOSTUNREACH, NSOLID_E_UV_EINTR = UV_EINTR,
  NSOLID_E_UV_EINVAL = UV_EINVAL, NSOLID_E_UV_EIO = UV_EIO, NSOLID_E_UV_EISCONN = UV_EISCONN, NSOLID_E_UV_EISDIR = UV_EISDIR,
  NSOLID_E_UV_ELOOP = UV_ELOOP, NSOLID_E_UV_EMFILE = UV_EMFILE, NSOLID_E_UV_EMSGSIZE = UV_EMSGSIZE, NSOLID_E_UV_ENAMETOOLONG = UV_ENAMETOOLONG,
  NSOLID_E_UV_ENETDOWN = UV_ENETDOWN, NSOLID_E_UV_ENETUNREACH = UV_ENETUNREACH, NSOLID_E_UV_ENFILE = UV_ENFILE, NSOLID_E_UV_ENOBUFS = UV_ENOBUFS,
  NSOLID_E_UV_ENODEV = UV_ENODEV, NSOLID_E_UV_ENOENT = UV_ENOENT, NSOLID_E_UV_ENOMEM = UV_ENOMEM, NSOLID_E_UV_ENONET = UV_ENONET,
  NSOLID_E_UV_ENOPROTOOPT = UV_ENOPROTOOPT, NSOLID_E_UV_ENOSPC = UV_ENOSPC, NSOLID_E_UV_ENOSYS = UV_ENOSYS, NSOLID_E_UV_ENOTCONN = UV_ENOTCONN,
  NSOLID_E_UV_ENOTDIR = UV_ENOTDIR, NSOLID_E_UV_ENOTEMPTY = UV_ENOTEMPTY, NSOLID_E_UV_ENOTSOCK = UV_ENOTSOCK, NSOLID_E_UV_ENOTSUP = UV_ENOTSUP,
  NSOLID_E_UV_EPERM = UV_EPERM, NSOLID_E_UV_EPIPE = UV_EPIPE, NSOLID_E_UV_EPROTO = UV_EPROTO, NSOLID_E_UV_EPROTONOSUPPORT = UV_EPROTONOSUPPORT,
  NSOLID_E_UV_EPROTOTYPE = UV_EPROTOTYPE, NSOLID_E_UV_ERANGE = UV_ERANGE, NSOLID_E_UV_EROFS = UV_EROFS, NSOLID_E_UV_ESHUTDOWN = UV_ESHUTDOWN,
  NSOLID_E_UV_ESPIPE = UV_ESPIPE, NSOLID_E_UV_ESRCH = UV_ESRCH, NSOLID_E_UV_ETIMEDOUT = UV_ETIMEDOUT, NSOLID_E_UV_ETXTBSY = UV_ETXTBSY,
  NSOLID_E_UV_EXDEV = UV_EXDEV, NSOLID_E_UV_UNKNOWN = UV_UNKNOWN, NSOLID_E_UV_EOF = UV_EOF, NSOLID_E_UV_ENXIO = UV_ENXIO,
  NSOLID_E_UV_EMLINK = UV_EMLINK, NSOLID_E_UV_EHOSTDOWN = UV_EHOSTDOWN, NSOLID_E_UV_EREMOTEIO = UV_EREMOTEIO, NSOLID_E_UV_ENOTTY = UV_ENOTTY,
  NSOLID_E_UV_EFTYPE = UV_EFTYPE, NSOLID_E_UV_EILSEQ = UV_EILSEQ
}
 List of errors returned by N|Solid C++ API.
 
enum  MetricsType : unsigned int { MetricsType::ECounter, MetricsType::EGauge, ESeries, EOther }
 Defines the types of metrics supported. More...
 

Functions

int ModuleInfo (uint64_t thread_id, std::string *json)
 to retrieve the list of packages used by the process More...
 
int ProcessInfo (std::string *json)
 returns relevant information about the running process and platform is running on. More...
 
template<typename Cb , typename... Data>
int OnBlockedLoopHook (uint64_t threshold, Cb &&cb, Data &&... data)
 Register a hook(function) to be called when the event loop of any of the active JS threads is blocked for longer than a threshold. More...
 
template<typename Cb , typename... Data>
int OnUnblockedLoopHook (Cb &&cb, Data &&... data)
 Register a hook(function) to be called when the event loop moves from the blocked-loop state to not being blocked. More...
 
template<typename Cb , typename... Data>
int ThreadAddedHook (Cb &&cb, Data &&... data)
 Register a hook(function) to be called any time a JS thread is created. More...
 
template<typename Cb , typename... Data>
int ThreadRemovedHook (Cb &&cb, Data &&... data)
 Register a hook(function) to be called any time a JS thread is destroyed. More...
 
template<typename Cb , typename... Data>
int OnLicenseHook (Cb &&cb, Data &&... data)
 Register a hook(function) to be called any time a license is set up in the N|Solid runtime. More...
 
void License (std::string token)
 configures a license in the N|Solid runtime More...
 
bool IsLicensed ()
 
uint64_t LicenseExpiration ()
 returns the expiration of the license in milliseconds since unix epoch or zero in case the runtime is unlicensed. More...
 
uint64_t ThreadId (v8::Local< v8::Context > context)
 returns the thread id from a specific v8::Context More...
 

Detailed Description

nsolid namespace

Enumeration Type Documentation

◆ MetricsType

enum node::nsolid::MetricsType : unsigned int
strong

Defines the types of metrics supported.

Enumerator
ECounter 

Single, monotonically increasing, cumulative metric.

EGauge 

A single numerical value that can arbitrarily go up and down.

Function Documentation

◆ IsLicensed()

bool node::nsolid::IsLicensed ( )
Returns
whether the N|Solid agent is licensed or not.

◆ License()

void node::nsolid::License ( std::string  token)

configures a license in the N|Solid runtime

Parameters
tokenthe actual license token.

◆ LicenseExpiration()

uint64_t node::nsolid::LicenseExpiration ( )

returns the expiration of the license in milliseconds since unix epoch or zero in case the runtime is unlicensed.

Returns
license expiration in milliseconds since unix epoch.

◆ ModuleInfo()

int node::nsolid::ModuleInfo ( uint64_t  thread_id,
std::string *  json 
)

to retrieve the list of packages used by the process

Parameters
jsonthe list of packages in json format.
Returns
NSOLID_E_SUCCESS in case of success or a different NSOLID_E_ error value otherwise.

◆ OnBlockedLoopHook()

template<typename Cb , typename... Data>
int node::nsolid::OnBlockedLoopHook ( uint64_t  threshold,
Cb &&  cb,
Data &&...  data 
)

Register a hook(function) to be called when the event loop of any of the active JS threads is blocked for longer than a threshold.

Parameters
thresholdin milliseconds that an event loop needs to be blocked before the registered hook is called.
cbhook function with the following signature: cb(uint64_t thread_id, std::string info, ...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.

◆ OnLicenseHook()

template<typename Cb , typename... Data>
int node::nsolid::OnLicenseHook ( Cb &&  cb,
Data &&...  data 
)

Register a hook(function) to be called any time a license is set up in the N|Solid runtime.

Parameters
cbhook function with the following signature: cb(bool licensed, uint64_t expiration, ...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.s

◆ OnUnblockedLoopHook()

template<typename Cb , typename... Data>
int node::nsolid::OnUnblockedLoopHook ( Cb &&  cb,
Data &&...  data 
)

Register a hook(function) to be called when the event loop moves from the blocked-loop state to not being blocked.

Parameters
cbhook function with the following signature: cb(uint64_t thread_id, std::string info, ...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.

◆ ProcessInfo()

int node::nsolid::ProcessInfo ( std::string *  json)

returns relevant information about the running process and platform is running on.

Parameters
jsonthe process information in json format.
Returns
NSOLID_E_SUCCESS in case of success or a different NSOLID_E_ error value otherwise.

◆ ThreadAddedHook()

template<typename Cb , typename... Data>
int node::nsolid::ThreadAddedHook ( Cb &&  cb,
Data &&...  data 
)

Register a hook(function) to be called any time a JS thread is created.

Parameters
cbhook function with the following signature: cb(uint64_t thread_id, ...Data) that will be called on JS thread creation.
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.

◆ ThreadId()

uint64_t node::nsolid::ThreadId ( v8::Local< v8::Context >  context)

returns the thread id from a specific v8::Context

Parameters
context
Returns
thread_id

◆ ThreadRemovedHook()

template<typename Cb , typename... Data>
int node::nsolid::ThreadRemovedHook ( Cb &&  cb,
Data &&...  data 
)

Register a hook(function) to be called any time a JS thread is destroyed.

Parameters
cbhook function with the following signature: cb(uint64_t thread_id, ...Data) that will be called on JS thread destruction.
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.