Packages

Prometheus.io process collector Collector exports the current state of process metrics including cpu, memory, file descriptor usage and native threads count as well as the process start and up times.

Retired package: Release invalid - breaks rebar3 compatibility

Current section

Files

Jump to
prometheus_process_collector c_src prometheus_process_info_mt.cc
Raw

c_src/prometheus_process_info_mt.cc

#include <stdlib.h>
#include <iostream>
#include <memory>
#include "prometheus_process_info.h"
int main(int argc, char **argv)
{
if (argc != 2)
{
// printf("Usage: %s <iterations>\n", argv[0]);
return 1;
}
char *dummy;
unsigned long iterations = strtoul(argv[1], &dummy, 10);
if (*dummy != '\0')
{
// printf("Iterations must be an integer\n");
return 1;
};
while (iterations--)
{
auto process_info = std::unique_ptr<Prometheus::ProcessInfo>(new Prometheus::ProcessInfo());
std::cout << process_info->threads_total << std::endl;
}
return 0;
}