@stephen-shopopop/node-metrics
    Preparing search index...

    Plugin for capturing and reporting the CPU usage of the current Node.js process.

    This plugin measures the user and system CPU time consumed by the process since the last capture, and sets the corresponding metrics in the provided MetricsContext.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    name: string = ProcessCpuUsagePlugin.name

    Methods

    • Captures the current process CPU usage metrics and sets them in the provided MetricsContext.

      Parameters

      • ctx: MetricsContext

        The MetricsContext instance where the CPU usage metrics will be recorded.

        Metrics recorded:

        • process_cpu_user_seconds_total: Total user CPU time in seconds.
        • process_cpu_system_seconds_total: Total system CPU time in seconds.
        • process_cpu_seconds_total: Total CPU time (user + system) in seconds.
        • process_pid: The process ID.

      Returns void