26 #include <string_view> 40 static constexpr std::string_view filePath =
"/proc/meminfo"sv;
42 static constexpr std::string_view sourcePrefix =
"memory"sv;
43 static constexpr std::array fieldUnitsAssociation = {
KeyUnit{
"huge_pages_"sv,
""sv} };
44 static constexpr std::string_view defaultUnit =
"bytes"sv;
62 size_t fieldCount() const noexcept override final;
63 const
std::vector<
size_t> indexesOfFieldName(const
FieldName& fieldName,
Interests* interests =
nullptr) const noexcept override final;
64 const
std::
string fieldNameSourcePrefix() const noexcept override final;
65 const
FieldInfo fieldInfoAtIndex(
size_t index) const noexcept override final;
66 const
std::vector<
FieldInfo> allFieldsInfo() const noexcept override final;
68 void fetchData(const
Interests& interests, DataArray::
Iterator current) override final;
Object used to describe a field (or metric)
Stuct to associate a field name containing a certain key with a unit.
std::vector< std::string > FieldName
Type used for field names (an array of strings)
Namespace for sources of metrics objects and operations.
std::vector< DataValueType >::const_iterator ConstIterator
Const iterator type of MetricsDataArray.
std::vector< std::string > fieldNames_
Metrics names.
std::vector< char > buffer_
Buffer to put file contents into.
std::ifstream file_
File descriptor.
Boolean array to keep track of which fields a source has to fetch metrics for.
Sources of memory metrics extracted from the file /proc/meminfo.
Singleton abstract class, base class of all metric sources classes.
std::vector< DataValueType >::iterator Iterator
Iterator type of MetricsDataArray.