#include "timemory/components/network/components.hpp"
|
static constexpr size_t | data_size = cache::network_stats::data_size |
|
Definition at line 43 of file components.hpp.
◆ base_type
◆ data_array_type
◆ iface_map_type
◆ storage_type
◆ string_array_type
◆ this_type
◆ value_type
◆ network_stats() [1/5]
tim::component::network_stats::network_stats |
( |
std::string |
_interface | ) |
|
|
inline |
Definition at line 126 of file components.hpp.
127: m_interfaces{ std::move(_interface) }
◆ network_stats() [2/5]
tim::component::network_stats::network_stats |
( |
std::vector< std::string > |
_interfaces | ) |
|
|
inline |
Definition at line 130 of file components.hpp.
131: m_interfaces{ std::move(_interfaces) }
◆ network_stats() [3/5]
tim::component::network_stats::network_stats |
( |
| ) |
|
|
default |
◆ ~network_stats()
tim::component::network_stats::~network_stats |
( |
| ) |
|
|
default |
◆ network_stats() [4/5]
tim::component::network_stats::network_stats |
( |
const network_stats & |
| ) |
|
|
default |
◆ network_stats() [5/5]
tim::component::network_stats::network_stats |
( |
network_stats && |
| ) |
|
|
default |
◆ data_array()
◆ description()
std::string tim::component::network_stats::description |
( |
| ) |
|
|
inlinestatic |
Definition at line 98 of file components.hpp.
100 return "Reports network bytes, packets, errors, dropped";
◆ description_array()
Definition at line 285 of file components.hpp.
287 return cache::network_stats::data_descriptions();
◆ display_unit_array()
Definition at line 279 of file components.hpp.
281 return cache::network_stats::data_display_units();
◆ get()
◆ get_display()
std::string tim::component::network_stats::get_display |
( |
| ) |
const |
|
inline |
Definition at line 204 of file components.hpp.
206 auto&& _get_display = [](
const int64_t& _val,
const std::string& _lbl,
208 std::stringstream ss;
220 auto _disp = cache::network_stats::data_display_units();
221 auto _labels = cache::network_stats::data_labels();
222 std::stringstream ss;
224 ss <<
", " << _get_display(_val.get_data()[i], _labels[i], _disp[i]);
225 return ss.str().substr(2);
tim::mpl::apply< std::string > string
static short get_precision()
static fmtflags get_format_flags()
cache::network_stats value_type
data_array_type get() const
References data_size, get(), tim::component::base< Tp, Value >::get_format_flags(), tim::component::base< Tp, Value >::get_precision(), and tim::component::base< Tp, Value >::get_width().
◆ get_interfaces()
std::vector< std::string > & tim::component::network_stats::get_interfaces |
( |
| ) |
|
|
inlinestatic |
Definition at line 135 of file components.hpp.
139 static std::vector<std::string> _instance{};
146 auto _update_instance = []() {
148 for(
auto&& itr :
delimit(_value,
" ,\t;"))
150 if(itr !=
"." && itr !=
"..")
151 _instance.emplace_back(std::move(itr));
155 if(_instance.empty())
164 for(
auto&& itr : utility::filesystem::list_directory(
"/sys/class/net"))
166 if(itr !=
"." && itr !=
"..")
167 _instance.emplace_back(std::move(itr));
169 if(_instance.empty())
171 std::stringstream _ss;
172 for(
const auto& itr : _instance)
174 _value = _last = _ss.str().substr(2);
178 else if(_last != _value)
char argparse::argument_parser tim::settings * _settings
TIMEMORY_SETTINGS_KEY("SUPPRESS_PARSING")) TIMEMORY_SETTINGS_MEMBER_DEF(bool
ContainerT delimit(const std::string &line, const std::string &delimiters="\"',;: ", PredicateT &&predicate=[](const std::string &s) -> std::string { return s;})
arg_result get(size_t _idx, Tp &_value)
static settings * instance()
References tim::_settings, tim::delimit(), tim::argparse::argument_parser::get(), tim::settings::instance(), and tim::TIMEMORY_SETTINGS_KEY().
Referenced by start().
◆ get_opaque()
template<typename... Args>
static opaque tim::component::empty_base::get_opaque |
( |
Args && |
... | ) |
|
|
inlinestaticinherited |
◆ label()
std::string tim::component::network_stats::label |
( |
| ) |
|
|
inlinestatic |
◆ label_array()
Definition at line 273 of file components.hpp.
275 return cache::network_stats::data_labels();
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ record() [1/2]
Definition at line 104 of file components.hpp.
106 if(_interface.empty())
107 return cache::network_stats{};
109 return cache::network_stats{ _interface };
Referenced by sample(), start(), and stop().
◆ record() [2/2]
Definition at line 113 of file components.hpp.
115 if(_interfaces.empty())
116 return cache::network_stats{};
117 cache::network_stats _data{};
118 for(
const auto& itr : _interfaces)
121 _data += cache::network_stats{ itr };
◆ sample()
void tim::component::network_stats::sample |
( |
| ) |
|
|
inline |
◆ start()
void tim::component::network_stats::start |
( |
| ) |
|
|
inline |
◆ stop()
void tim::component::network_stats::stop |
( |
| ) |
|
|
inline |
◆ unit_array()
Definition at line 267 of file components.hpp.
269 return cache::network_stats::data_units();
◆ data_size
constexpr size_t tim::component::network_stats::data_size = cache::network_stats::data_size |
|
staticconstexpr |
The documentation for this struct was generated from the following file: