Class that allows to retrieve thread-specific metrics from a process.
More...
#include <nsolid.h>
|
| ThreadMetrics (uint64_t thread_id) |
| Construct a new Thread Metrics object. More...
|
|
| ~ThreadMetrics () |
| Destroy the Thread Metrics object. More...
|
|
std::string | toJSON () |
| Returns the current N|Solid JS thread metrics in JSON format. More...
|
|
int | Get (MetricsStor *stor) |
| It retrieves the current N|Solid JS thread metrics. A previous call to Update() is needed. More...
|
|
template<typename Cb , typename... Data> |
int | Update (Cb &&cb, Data &&... data) |
| Calculates and stores the N|Solid JS thread metrics. A callback is called when the retrieval has completed. More...
|
|
Class that allows to retrieve thread-specific metrics from a process.
◆ ThreadMetrics()
node::nsolid::ThreadMetrics::ThreadMetrics |
( |
uint64_t |
thread_id | ) |
|
|
explicit |
Construct a new Thread Metrics object.
- Parameters
-
thread_id | the id of the JS thread the metrics are going to be retrieved from. |
◆ ~ThreadMetrics()
node::nsolid::ThreadMetrics::~ThreadMetrics |
( |
| ) |
|
Destroy the Thread Metrics object.
◆ Get()
int node::nsolid::ThreadMetrics::Get |
( |
MetricsStor * |
stor | ) |
|
It retrieves the current N|Solid JS thread metrics. A previous call to Update() is needed.
- Parameters
-
stor | A MetricsStor object where the actual metrics will be written to. |
- Returns
- NSOLID_E_SUCCESS in case of success or a different NSOLID_E_ error value otherwise.
◆ toJSON()
std::string node::nsolid::ThreadMetrics::toJSON |
( |
| ) |
|
Returns the current N|Solid JS thread metrics in JSON format.
- Returns
- std::string
◆ Update()
template<typename Cb , typename... Data>
int node::nsolid::ThreadMetrics::Update |
( |
Cb && |
cb, |
|
|
Data &&... |
data |
|
) |
| |
Calculates and stores the N|Solid JS thread metrics. A callback is called when the retrieval has completed.
- Parameters
-
cb | callback function with the following signature void(*)(ThreadMetrics*, ...Data) |
data | variable 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: