Peer stats snapshot move around

This commit is contained in:
Igor Katson 2023-11-20 14:05:38 +00:00
parent e214dd47a5
commit a93a588ae9
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 85 additions and 91 deletions

View file

@ -17,9 +17,10 @@ use tracing::{info, warn};
use axum::Router;
use crate::http_api_error::{ApiError, ApiErrorExt};
use crate::peer_state::PeerStatsFilter;
use crate::session::{AddTorrentOptions, AddTorrentResponse, ListOnlyResponse, Session};
use crate::torrent_manager::TorrentManagerHandle;
use crate::torrent_state::{PeerStatsFilter, StatsSnapshot};
use crate::torrent_state::StatsSnapshot;
// Public API
#[derive(Clone)]
@ -274,7 +275,7 @@ impl ApiInternal {
&self,
idx: usize,
filter: PeerStatsFilter,
) -> Result<crate::torrent_state::PeerStatsSnapshot> {
) -> Result<crate::peer_state::PeerStatsSnapshot> {
let handle = self.mgr_handle(idx)?;
Ok(handle.torrent_state().per_peer_stats_snapshot(filter))
}