N|Solid
Classes | Namespaces | Macros | Enumerations | Functions
nsolid.h File Reference
#include "node.h"
#include "uv.h"
#include <string>
Include dependency graph for nsolid.h:

Go to the source code of this file.

Classes

class  node::nsolid::ProcessMetrics
 Class that allows to retrieve process-wide metrics. More...
 
struct  node::nsolid::ProcessMetrics::MetricsStor
 POD type to store process metrics data. More...
 
class  node::nsolid::ThreadMetrics
 Class that allows to retrieve thread-specific metrics from a process. More...
 
struct  node::nsolid::ThreadMetrics::MetricsStor
 POD type to store thread metrics data. More...
 
class  node::nsolid::MetricsStream
 Class to retrieve a stream of some thread-specific metrics. More...
 
class  node::nsolid::CpuProfiler
 class that allows to take CPU profiles from a specific JS thread. More...
 
class  node::nsolid::Snapshot
 class that allows taking heap snapshots from a specific JS thread. More...
 

Namespaces

 node
 node namespace
 
 node::nsolid
 nsolid namespace
 

Macros

#define NSOLID_PROCESS_METRICS_STRINGS(V)
 
#define NSOLID_PROCESS_METRICS_NUMBERS(V)
 
#define NSOLID_PROCESS_METRICS(V)
 
#define NSOLID_ENV_METRICS(V)
 
#define NSOLID_ERRORS(V)
 
#define V(Type, Value, Msg)   NSOLID_E_##Type = Value,
 
#define X(Type, Msg)   NSOLID_E_UV_ ## Type = UV_ ## Type,
 
#define PM1(Type, CName, JSName, MType)   Type CName;
 
#define PM2(Type, CName, JSName, MType)   Type CName = 0;
 
#define EM(Type, CName, JSName, MType)   Type CName = 0;
 

Enumerations

enum  node::nsolid::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  node::nsolid::MetricsType : unsigned int { node::nsolid::MetricsType::ECounter, node::nsolid::MetricsType::EGauge, ESeries, EOther }
 Defines the types of metrics supported. More...
 

Functions

int node::nsolid::ModuleInfo (uint64_t thread_id, std::string *json)
 to retrieve the list of packages used by the process More...
 
int node::nsolid::ProcessInfo (std::string *json)
 returns relevant information about the running process and platform is running on. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void node::nsolid::License (std::string token)
 configures a license in the N|Solid runtime More...
 
bool node::nsolid::IsLicensed ()
 
uint64_t node::nsolid::LicenseExpiration ()
 returns the expiration of the license in milliseconds since unix epoch or zero in case the runtime is unlicensed. More...
 
uint64_t node::nsolid::ThreadId (v8::Local< v8::Context > context)
 returns the thread id from a specific v8::Context More...
 

Detailed Description

N|Solid C++ API header file

Macro Definition Documentation

◆ NSOLID_ERRORS

#define NSOLID_ERRORS (   V)
Value:
V(SUCCESS, 0, "Success") \
V(NOT_LICENSED, 1, "N|Solid Runtime is not Licensed")

◆ NSOLID_PROCESS_METRICS

#define NSOLID_PROCESS_METRICS (   V)
Value:
NSOLID_PROCESS_METRICS_STRINGS(V) \
NSOLID_PROCESS_METRICS_NUMBERS(V)

◆ NSOLID_PROCESS_METRICS_NUMBERS

#define NSOLID_PROCESS_METRICS_NUMBERS (   V)
Value:
V(uint64_t, timestamp, timestamp, ECounter) \
V(uint64_t, uptime, uptime, ECounter) \
V(uint64_t, system_uptime, systemUptime, ECounter) \
V(uint64_t, free_mem, freeMem, EGauge) \
V(uint64_t, block_input_op_count, blockInputOpCount, ECounter) \
V(uint64_t, block_output_op_count, blockOutputOpCount, ECounter) \
V(uint64_t, ctx_switch_involuntary_count, \
ctxSwitchInvoluntaryCount, \
ECounter) \
V(uint64_t, ctx_switch_voluntary_count, ctxSwitchVoluntaryCount, ECounter) \
V(uint64_t, ipc_received_count, ipcReceivedCount, ECounter) \
V(uint64_t, ipc_sent_count, ipcSentCount, ECounter) \
V(uint64_t, page_fault_hard_count, pageFaultHardCount, ECounter) \
V(uint64_t, page_fault_soft_count, pageFaultSoftCount, ECounter) \
V(uint64_t, signal_count, signalCount, ECounter) \
V(uint64_t, swap_count, swapCount, ECounter) \
V(uint64_t, rss, rss, EGauge) \
V(double, load_1m, load1m, EGauge) \
V(double, load_5m, load5m, EGauge) \
V(double, load_15m, load15m, EGauge) \
V(double, cpu_user_percent, cpuUserPercent, EGauge) \
V(double, cpu_system_percent, cpuSystemPercent, EGauge) \
V(double, cpu_percent, cpuPercent, EGauge)

◆ NSOLID_PROCESS_METRICS_STRINGS

#define NSOLID_PROCESS_METRICS_STRINGS (   V)
Value:
V(std::string, title, title, EOther) \
V(std::string, user, user, EOther)