Add session.get_cache_status() to the python bindings
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <libtorrent/torrent.hpp>
|
||||
#include <libtorrent/storage.hpp>
|
||||
#include <libtorrent/ip_filter.hpp>
|
||||
#include <libtorrent/disk_io_thread.hpp>
|
||||
#include "gil.hpp"
|
||||
|
||||
using namespace boost::python;
|
||||
@@ -235,6 +236,17 @@ void bind_session()
|
||||
.value("start_default_features", session::start_default_features)
|
||||
;
|
||||
|
||||
class_<cache_status>("cache_status")
|
||||
.def_readonly("blocks_written", &cache_status::blocks_written)
|
||||
.def_readonly("writes", &cache_status::writes)
|
||||
.def_readonly("blocks_read", &cache_status::blocks_read)
|
||||
.def_readonly("blocks_read_hit", &cache_status::blocks_read_hit)
|
||||
.def_readonly("reads", &cache_status::reads)
|
||||
.def_readonly("cache_size", &cache_status::cache_size)
|
||||
.def_readonly("read_cache_size", &cache_status::read_cache_size)
|
||||
.def_readonly("total_used_buffers", &cache_status::total_used_buffers)
|
||||
;
|
||||
|
||||
class_<session, boost::noncopyable>("session", no_init)
|
||||
.def(
|
||||
init<fingerprint, int>((
|
||||
@@ -326,6 +338,7 @@ void bind_session()
|
||||
.def("resume", allow_threads(&session::resume))
|
||||
.def("is_paused", allow_threads(&session::is_paused))
|
||||
.def("id", allow_threads(&session::id))
|
||||
.def("get_cache_status", allow_threads(&session::get_cache_status))
|
||||
;
|
||||
|
||||
register_ptr_to_python<std::auto_ptr<alert> >();
|
||||
|
Reference in New Issue
Block a user