logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

"Net::Prometheus::ProcessCollector" - obtain a process collector for the OS

Author

       Paul Evans <leonerd@leonerd.org.uk>

perl v5.40.0                                       2024-11-09             Net::Prometheus::ProcessCollector(3pm)

Description

       This module-loading package provides a method that attempts to load a process collector appropriate for
       the host OS it is running on.

       The following OS-specific modules are provided with this distribution:

       • Net::Prometheus::ProcessCollector::linux

       Other OSes may be supported by 3rd-party CPAN modules by following this naming pattern based on the value
       of the $^O variable on the OS concerned.

Magic Constructors

new
          $collector = Net::Prometheus::ProcessCollector->new( %args );

       Attempts  to  construct  a  new process collector for the OS named by $^O, passing in any extra arguments
       into the "new" constructor for the specific class.

       If no perl module is found under the appropriate file name, "undef"  is  returned.  If  any  other  error
       occurs while loading or constructing the instance, the exception is thrown as normal.

       Typically a process exporter should support the following named arguments:

       prefix => STR
           A  prefix  to  prepend  on  all  the  exported variable names. If not provided, the default should be
           "process".

       labels => ARRAY
           Additional labels to set on exported variables. If not provided, no extra labels will be set.

   for_OS
          $collector = Net::Prometheus::ProcessCollector->for_OS( $os, @args );

       Attempts to construct a new process collector for  the  named  OS.  Except  under  especially-exceptional
       circumstances, you don't want to call this method.  Call "new" instead.

Name

       "Net::Prometheus::ProcessCollector" - obtain a process collector for the OS

Synopsis

          use Net::Prometheus::ProcessCollector;

          my $collector = Net::Prometheus::ProcessCollector->new;

See Also