Expose HTTP /stats endpoint
This commit is contained in:
parent
5d3a93b8bd
commit
561c8b8a1d
5 changed files with 46 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ use crate::{
|
|||
session::{
|
||||
AddTorrent, AddTorrentOptions, AddTorrentResponse, ListOnlyResponse, Session, TorrentId,
|
||||
},
|
||||
session_stats::snapshot::SessionStatsSnapshot,
|
||||
torrent_state::{
|
||||
peer::stats::snapshot::{PeerStatsFilter, PeerStatsSnapshot},
|
||||
FileStream, ManagedTorrentHandle,
|
||||
|
|
@ -171,6 +172,10 @@ impl Api {
|
|||
make_torrent_details(&info_hash, &handle.info().info, only_files.as_deref())
|
||||
}
|
||||
|
||||
pub fn api_session_stats(&self) -> SessionStatsSnapshot {
|
||||
self.session().stats_snapshot()
|
||||
}
|
||||
|
||||
pub fn torrent_file_mime_type(
|
||||
&self,
|
||||
idx: TorrentIdOrHash,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue