Version: 0.0.1

home

[report issue]

stats_metric

Declared in "libtorrent/session_stats.hpp"

describes one statistics metric from the session. For more information, see the session statistics section.

struct stats_metric
{
   char const* name;
   int value_index;
   metric_type_t type;
};
[report issue]
name
the name of the counter or gauge
[report issue]
value_index type
the index into the session stats array, where the underlying value of this counter or gauge is found. The session stats array is part of the session_stats_alert object.
[report issue]

session_stats_metrics()

Declared in "libtorrent/session_stats.hpp"

std::vector<stats_metric> session_stats_metrics ();

This free function returns the list of available metrics exposed by libtorrent's statistics API. Each metric has a name and a value index. The value index is the index into the array in session_stats_alert where this metric's value can be found when the session stats is sampled (by calling post_session_stats()).

[report issue]

find_metric_idx()

Declared in "libtorrent/session_stats.hpp"

int find_metric_idx (string_view name);

given a name of a metric, this function returns the counter index of it, or -1 if it could not be found. The counter index is the index into the values array returned by session_stats_alert.

[report issue]

enum metric_type_t

Declared in "libtorrent/session_stats.hpp"

name value description
counter 0  
gauge 1