2014-07-09 23:25:02 +02:00
|
|
|
#ifndef SESSION_VIEW_HPP_
|
|
|
|
#define SESSION_VIEW_HPP_
|
|
|
|
|
2015-04-25 06:22:51 +02:00
|
|
|
#include "libtorrent/session_stats.hpp"
|
2016-06-18 20:01:38 +02:00
|
|
|
#include <cstdint>
|
2014-07-09 23:25:02 +02:00
|
|
|
|
|
|
|
namespace lt = libtorrent;
|
|
|
|
|
|
|
|
struct session_view
|
|
|
|
{
|
|
|
|
session_view();
|
|
|
|
|
|
|
|
void set_pos(int pos);
|
|
|
|
|
|
|
|
int pos() const;
|
|
|
|
|
|
|
|
int height() const;
|
|
|
|
|
|
|
|
void render();
|
|
|
|
|
2015-01-04 22:31:02 +01:00
|
|
|
void print_utp_stats(bool p) { m_print_utp_stats = p; }
|
|
|
|
bool print_utp_stats() const { return m_print_utp_stats; }
|
|
|
|
|
2016-10-19 07:32:15 +02:00
|
|
|
void update_counters(std::int64_t const* stats_counters, int num_cnt
|
2016-06-18 20:01:38 +02:00
|
|
|
, std::uint64_t t);
|
2014-07-09 23:25:02 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
int m_position;
|
2014-07-10 10:32:32 +02:00
|
|
|
int m_width;
|
2014-07-09 23:25:02 +02:00
|
|
|
|
|
|
|
// there are two sets of counters. the current one and the last one. This
|
|
|
|
// is used to calculate rates
|
2016-10-16 09:12:41 +02:00
|
|
|
std::vector<std::int64_t> m_cnt[2];
|
2014-07-09 23:25:02 +02:00
|
|
|
|
|
|
|
// the timestamps of the counters in m_cnt[0] and m_cnt[1]
|
|
|
|
// respectively. The timestamps are microseconds since session start
|
2016-06-18 20:01:38 +02:00
|
|
|
std::uint64_t m_timestamp[2];
|
2014-07-09 23:25:02 +02:00
|
|
|
|
2015-01-04 22:31:02 +01:00
|
|
|
bool m_print_utp_stats;
|
|
|
|
|
2014-07-09 23:25:02 +02:00
|
|
|
int m_queued_bytes_idx;
|
|
|
|
int m_wasted_bytes_idx;
|
|
|
|
int m_failed_bytes_idx;
|
|
|
|
int m_num_peers_idx;
|
|
|
|
int m_recv_payload_idx;
|
|
|
|
int m_sent_payload_idx;
|
|
|
|
int m_unchoked_idx;
|
|
|
|
int m_unchoke_slots_idx;
|
|
|
|
int m_limiter_up_queue_idx;
|
|
|
|
int m_limiter_down_queue_idx;
|
|
|
|
int m_queued_writes_idx;
|
|
|
|
int m_queued_reads_idx;
|
|
|
|
int m_writes_cache_idx;
|
|
|
|
int m_reads_cache_idx;
|
|
|
|
int m_pinned_idx;
|
|
|
|
int m_num_blocks_read_idx;
|
|
|
|
int m_cache_hit_idx;
|
|
|
|
int m_blocks_in_use_idx;
|
|
|
|
int m_blocks_written_idx;
|
|
|
|
int m_write_ops_idx;
|
2014-07-10 10:32:32 +02:00
|
|
|
|
|
|
|
int m_mfu_size_idx;
|
|
|
|
int m_mfu_ghost_idx;
|
|
|
|
int m_mru_size_idx;
|
|
|
|
int m_mru_ghost_idx;
|
2015-01-04 22:31:02 +01:00
|
|
|
|
|
|
|
int m_utp_idle;
|
|
|
|
int m_utp_syn_sent;
|
|
|
|
int m_utp_connected;
|
|
|
|
int m_utp_fin_sent;
|
|
|
|
int m_utp_close_wait;
|
2014-07-09 23:25:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|