Poco::Prometheus

class ProcessCollector

Library: Prometheus
Package: Collectors
Header: Poco/Prometheus/ProcessCollector.h

Description

This Collector provides process-specific metrics:

  • process_cpu_seconds_total: Total user and system CPU time spent in seconds.
  • process_max_fds: Maximum number of open file descriptors.
  • process_start_time_seconds: Start time of the process since unix epoch in seconds (actually, the time the Prometheus library was loaded).
  • process_up_time_seconds: Up time of the process in seconds (actually, time since the Prometheus library was loaded).

Inheritance

Direct Base Classes: Collector

All Base Classes: Collector

Member Summary

Member Functions: buildMetrics, exportTo, startTime

Inherited Functions: exportTo, name, validateName

Constructors

ProcessCollector

ProcessCollector();

Creates a default ProcessCollector.

ProcessCollector

ProcessCollector(
    const std::string & name,
    Registry * pRegistry
);

Creates a custom ProcessCollector with the given name (prefix) and registers it with the given Registry.

Destructor

~ProcessCollector virtual

~ProcessCollector() = default;

Destroys the ProcessCollector.

Member Functions

exportTo virtual

void exportTo(
    Exporter & exporter
) const override;

Writes the given Metric to the Exporter.

startTime static inline

static Poco::Timestamp startTime();

Returns the process start time.

buildMetrics protected

void buildMetrics();