|
MetroCollect
2.3.4
|
Sources of memory metrics extracted from the file /proc/meminfo. More...
#include <SourceProcMeminfo.h>


Public Member Functions | |
| size_t | fieldCount () const noexcept override final |
| Get the number of field the source has. More... | |
| const std::vector< size_t > | indexesOfFieldName (const FieldName &fieldName, Interests *interests=nullptr) const noexcept override final |
| Search for fields associated to a specific name. More... | |
| const std::string | fieldNameSourcePrefix () const noexcept override final |
| Get the prefix by which all field names should begin with. More... | |
| const FieldInfo | fieldInfoAtIndex (size_t index) const noexcept override final |
| Get details about a specific field. More... | |
| const std::vector< FieldInfo > | allFieldsInfo () const noexcept override final |
| Get all fields details, field which share a common name should appear only once. More... | |
| void | fetchData (const Interests &interests, DataArray::Iterator current) override final |
| Fetch the latest metrics. More... | |
| void | computeDiff (const Interests &interests, DiffArray::Iterator diff, DataArray::ConstIterator current, DataArray::ConstIterator previous, double factor=1) noexcept override final |
| Compute the variation (in appropriate unit) of metrics. More... | |
Public Member Functions inherited from MetroCollect::MetricsSource::SourceBase | |
| SourceBase (const SourceBase &)=delete | |
| Deleted copy constructor. More... | |
| void | operator= (const SourceBase &)=delete |
| Deleted copy operator. More... | |
Static Public Member Functions | |
| static SourceProcMeminfo & | get () |
| Get the Instance object. More... | |
Protected Member Functions | |
| SourceProcMeminfo () | |
| Private default constructor. More... | |
| void | parseFields () |
| File parser function. More... | |
Protected Member Functions inherited from MetroCollect::MetricsSource::SourceBase | |
| SourceBase () | |
| Protected default constructor. More... | |
| ~SourceBase () | |
| Protected default destructor. More... | |
Protected Attributes | |
| std::ifstream | file_ |
| File descriptor. More... | |
| std::vector< char > | buffer_ |
| Buffer to put file contents into. More... | |
| std::vector< std::string > | fieldNames_ |
| Metrics names. More... | |
Static Protected Attributes | |
| static constexpr std::string_view | filePath = "/proc/meminfo"sv |
| Memory metrics file path. More... | |
| static constexpr std::string_view | sourcePrefix = "memory"sv |
| Metrics name source prefix. More... | |
| static constexpr std::array | fieldUnitsAssociation = { KeyUnit{"huge_pages_"sv, ""sv} } |
| Metric units associations. More... | |
| static constexpr std::string_view | defaultUnit = "bytes"sv |
| Metric unit. More... | |
Sources of memory metrics extracted from the file /proc/meminfo.
Definition at line 38 of file SourceProcMeminfo.h.
|
protected |
Private default constructor.
Definition at line 28 of file SourceProcMeminfo.cc.

|
finaloverridevirtualnoexcept |
Get all fields details, field which share a common name should appear only once.
Implements MetroCollect::MetricsSource::SourceBase.
Definition at line 103 of file SourceProcMeminfo.cc.
|
finaloverridevirtualnoexcept |
Compute the variation (in appropriate unit) of metrics.
| interests | interests boolean array to know for which fields metrics variation should be computed |
| diff | iterator to write metrics variation to |
| current | iterator to read latest metrics from |
| previous | iterator to read previous metrics from |
| factor | factor to convert to unit per second, if relevant |
Implements MetroCollect::MetricsSource::SourceBase.
Definition at line 155 of file SourceProcMeminfo.cc.
|
finaloverridevirtual |
Fetch the latest metrics.
| interests | boolean array to know for which fields metrics should be fetched |
| current | iterator to write metrics to |
Implements MetroCollect::MetricsSource::SourceBase.
Definition at line 111 of file SourceProcMeminfo.cc.

|
finaloverridevirtualnoexcept |
Get the number of field the source has.
Implements MetroCollect::MetricsSource::SourceBase.
Definition at line 76 of file SourceProcMeminfo.cc.

|
finaloverridevirtualnoexcept |
Get details about a specific field.
| index | index of the field to get details of |
Implements MetroCollect::MetricsSource::SourceBase.
Definition at line 97 of file SourceProcMeminfo.cc.

|
finaloverridevirtualnoexcept |
Get the prefix by which all field names should begin with.
Implements MetroCollect::MetricsSource::SourceBase.
Definition at line 93 of file SourceProcMeminfo.cc.
|
inlinestatic |
Get the Instance object.
Definition at line 57 of file SourceProcMeminfo.h.
|
finaloverridevirtualnoexcept |
Search for fields associated to a specific name.
| fieldName | the name of the fields to search |
| interests | if the pointer is not nullptr, the interest bit corresponding to the fields will be set |
Implements MetroCollect::MetricsSource::SourceBase.
Definition at line 80 of file SourceProcMeminfo.cc.
|
protected |
File parser function.
Definition at line 34 of file SourceProcMeminfo.cc.


|
protected |
Buffer to put file contents into.
Definition at line 47 of file SourceProcMeminfo.h.
|
staticprotected |
Metric unit.
Definition at line 44 of file SourceProcMeminfo.h.
|
protected |
Metrics names.
Definition at line 48 of file SourceProcMeminfo.h.
|
staticprotected |
Metric units associations.
Definition at line 43 of file SourceProcMeminfo.h.
|
protected |
File descriptor.
Definition at line 46 of file SourceProcMeminfo.h.
|
staticprotected |
Memory metrics file path.
Definition at line 40 of file SourceProcMeminfo.h.
|
staticprotected |
Metrics name source prefix.
Definition at line 42 of file SourceProcMeminfo.h.