|
MetroCollect
2.3.4
|
Sources of network metrics extracted from Ethtool interface. More...
#include <SourceEthtool.h>


Classes | |
| class | EthtoolPointer |
| Class managing a pointer to a dynamically sized type. More... | |
| struct | InterfaceInfo |
| Class to store the details and metrics names of a network interface. More... | |
| struct | Socketfd |
| Struct managing an Ethtool socket. More... | |
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 SourceEthtool & | get () |
| Get the Instance object. More... | |
Protected Member Functions | |
| SourceEthtool () | |
| Private default constructor. More... | |
| void | gatherIfData () |
| Gather details on interfaces. More... | |
| InterfaceInfo::NameAndIndex | parseEthtoolString (std::string ethtoolString) |
| Parse raw Ethtool metric name. More... | |
| void | ixgbeIfFilter (InterfaceInfo &ifInfo) |
| Filter out relevant metrics for ixgbe driver. More... | |
Protected Member Functions inherited from MetroCollect::MetricsSource::SourceBase | |
| SourceBase () | |
| Protected default constructor. More... | |
| ~SourceBase () | |
| Protected default destructor. More... | |
Protected Attributes | |
| std::vector< InterfaceInfo > | ifInfo_ |
| Array holding details of each network interface. More... | |
| Socketfd | socketfd_ |
| Ethtool socket manager. More... | |
Static Protected Attributes | |
| static constexpr std::string_view | sourcePrefix = "ethtool"sv |
| Metrics name source prefix. More... | |
| static constexpr std::string_view | fieldNameAll = "*"sv |
| Metrics name wildcard. More... | |
| static constexpr std::string_view | fieldNameInterfaceDescription = "interface"sv |
| Metrics name category description. More... | |
| static constexpr std::string_view | fieldNameIndexDescription = "index"sv |
| Metrics name category description. More... | |
| static constexpr std::array | fieldUnitsAssociation = { KeyUnit{"bytes"sv, "bytes"sv}, KeyUnit{"packets"sv, "packets"sv}, KeyUnit{"pkts"sv, "packets"sv} } |
| Metric units associations. More... | |
| static constexpr std::string_view | defaultUnit = ""sv |
| Metric unit. More... | |
Sources of network metrics extracted from Ethtool interface.
Definition at line 40 of file SourceEthtool.h.
|
protected |
Private default constructor.
Definition at line 65 of file SourceEthtool.cc.

|
finaloverridevirtualnoexcept |
Get all fields details, field which share a common name should appear only once.
Implements MetroCollect::MetricsSource::SourceBase.
Definition at line 253 of file SourceEthtool.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 315 of file SourceEthtool.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 289 of file SourceEthtool.cc.

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

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

|
finaloverridevirtualnoexcept |
Get the prefix by which all field names should begin with.
Implements MetroCollect::MetricsSource::SourceBase.
Definition at line 231 of file SourceEthtool.cc.
|
protected |
Gather details on interfaces.
Definition at line 70 of file SourceEthtool.cc.


|
inlinestatic |
Get the Instance object.
Definition at line 247 of file SourceEthtool.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 204 of file SourceEthtool.cc.
|
protected |
Filter out relevant metrics for ixgbe driver.
Definition at line 176 of file SourceEthtool.cc.

|
protected |
Parse raw Ethtool metric name.
Definition at line 129 of file SourceEthtool.cc.

|
staticprotected |
Metric unit.
Definition at line 47 of file SourceEthtool.h.
|
staticprotected |
Metrics name wildcard.
Definition at line 43 of file SourceEthtool.h.
|
staticprotected |
Metrics name category description.
Definition at line 45 of file SourceEthtool.h.
|
staticprotected |
Metrics name category description.
Definition at line 44 of file SourceEthtool.h.
|
staticprotected |
Metric units associations.
Definition at line 46 of file SourceEthtool.h.
|
protected |
Array holding details of each network interface.
Definition at line 235 of file SourceEthtool.h.
|
protected |
Ethtool socket manager.
Definition at line 236 of file SourceEthtool.h.
|
staticprotected |
Metrics name source prefix.
Definition at line 42 of file SourceEthtool.h.