mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 02:56:18 +00:00
@@ -15,13 +15,13 @@ use ecstore::peer::is_reserved_or_invalid_bucket;
|
||||
use ecstore::store::is_valid_object_prefix;
|
||||
use ecstore::store_api::StorageAPI;
|
||||
use ecstore::utils::path::path_join;
|
||||
use ecstore::utils::time::parse_duration;
|
||||
use ecstore::utils::xml;
|
||||
use ecstore::GLOBAL_Endpoints;
|
||||
use futures::{Stream, StreamExt};
|
||||
use http::Uri;
|
||||
use hyper::StatusCode;
|
||||
use madmin::metrics::RealtimeMetrics;
|
||||
use madmin::utils::parse_duration;
|
||||
use matchit::Params;
|
||||
use s3s::stream::{ByteStream, DynByteStream};
|
||||
use s3s::{
|
||||
@@ -45,6 +45,7 @@ use tokio_stream::wrappers::ReceiverStream;
|
||||
use tracing::{error, info, warn};
|
||||
|
||||
pub mod service_account;
|
||||
pub mod trace;
|
||||
|
||||
#[derive(Deserialize, Debug, Default)]
|
||||
#[serde(rename_all = "PascalCase", default)]
|
||||
@@ -370,8 +371,8 @@ impl Operation for MetricsHandler {
|
||||
info!("mp: {:?}", mp);
|
||||
|
||||
let tick = match parse_duration(&mp.tick) {
|
||||
Some(i) => i,
|
||||
None => std_Duration::from_secs(1),
|
||||
Ok(i) => i,
|
||||
Err(_) => std_Duration::from_secs(1),
|
||||
};
|
||||
|
||||
let mut n = mp.n;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
use ecstore::{peer_rest_client::PeerRestClient, GLOBAL_Endpoints};
|
||||
use http::StatusCode;
|
||||
use hyper::Uri;
|
||||
use madmin::service_commands::ServiceTraceOpts;
|
||||
use matchit::Params;
|
||||
use s3s::{s3_error, Body, S3Request, S3Response, S3Result};
|
||||
use tokio::sync::mpsc;
|
||||
use tracing::warn;
|
||||
|
||||
use crate::admin::router::Operation;
|
||||
|
||||
fn extract_trace_options(uri: &Uri) -> S3Result<ServiceTraceOpts> {
|
||||
let mut st_opts = ServiceTraceOpts::default();
|
||||
st_opts
|
||||
.parse_params(uri)
|
||||
.map_err(|_| s3_error!(InvalidRequest, "invalid params"))?;
|
||||
|
||||
Ok(st_opts)
|
||||
}
|
||||
|
||||
pub struct Trace {}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl Operation for Trace {
|
||||
async fn call(&self, req: S3Request<Body>, _params: Params<'_, '_>) -> S3Result<S3Response<(StatusCode, Body)>> {
|
||||
warn!("handle Trace");
|
||||
|
||||
let trace_opts = extract_trace_options(&req.uri)?;
|
||||
|
||||
// let (tx, rx) = mpsc::channel(10000);
|
||||
let perrs = match GLOBAL_Endpoints.get() {
|
||||
Some(ep) => PeerRestClient::new_clients(ep).await,
|
||||
None => (Vec::new(), Vec::new()),
|
||||
};
|
||||
return Err(s3_error!(NotImplemented));
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1349,7 +1349,7 @@ impl Node for NodeService {
|
||||
}
|
||||
}
|
||||
});
|
||||
let data_usage_cache = disk.ns_scanner(&cache, updates_tx, request.scan_mode as usize).await;
|
||||
let data_usage_cache = disk.ns_scanner(&cache, updates_tx, request.scan_mode as usize, None).await;
|
||||
let _ = task.await;
|
||||
match data_usage_cache {
|
||||
Ok(data_usage_cache) => {
|
||||
|
||||
Reference in New Issue
Block a user