mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 07:27:37 +00:00
fix feedback
This commit is contained in:
@@ -1601,12 +1601,13 @@ impl DiskAPI for RemoteDisk {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
global_internode_metrics().record_sent_bytes_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL, data_len);
|
||||||
|
|
||||||
if !response.success {
|
if !response.success {
|
||||||
global_internode_metrics().record_error_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL);
|
global_internode_metrics().record_error_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL);
|
||||||
return Err(response.error.unwrap_or_default().into());
|
return Err(response.error.unwrap_or_default().into());
|
||||||
}
|
}
|
||||||
|
|
||||||
global_internode_metrics().record_sent_bytes_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL, data_len);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
},
|
},
|
||||||
get_max_timeout_duration(),
|
get_max_timeout_duration(),
|
||||||
|
|||||||
@@ -933,16 +933,14 @@ impl NodeService {
|
|||||||
pub(super) async fn handle_write_all(&self, request: Request<WriteAllRequest>) -> Result<Response<WriteAllResponse>, Status> {
|
pub(super) async fn handle_write_all(&self, request: Request<WriteAllRequest>) -> Result<Response<WriteAllResponse>, Status> {
|
||||||
let request = request.into_inner();
|
let request = request.into_inner();
|
||||||
let data_len = request.data.len();
|
let data_len = request.data.len();
|
||||||
|
global_internode_metrics().record_incoming_request_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL);
|
||||||
|
global_internode_metrics().record_recv_bytes_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL, data_len);
|
||||||
if let Some(disk) = self.find_disk(&request.disk).await {
|
if let Some(disk) = self.find_disk(&request.disk).await {
|
||||||
match disk.write_all(&request.volume, &request.path, request.data).await {
|
match disk.write_all(&request.volume, &request.path, request.data).await {
|
||||||
Ok(_) => {
|
Ok(_) => Ok(Response::new(WriteAllResponse {
|
||||||
global_internode_metrics().record_incoming_request_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL);
|
success: true,
|
||||||
global_internode_metrics().record_recv_bytes_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL, data_len);
|
error: None,
|
||||||
Ok(Response::new(WriteAllResponse {
|
})),
|
||||||
success: true,
|
|
||||||
error: None,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
global_internode_metrics().record_error_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL);
|
global_internode_metrics().record_error_for_operation(INTERNODE_OPERATION_GRPC_WRITE_ALL);
|
||||||
Ok(Response::new(WriteAllResponse {
|
Ok(Response::new(WriteAllResponse {
|
||||||
@@ -964,10 +962,10 @@ impl NodeService {
|
|||||||
debug!("read all");
|
debug!("read all");
|
||||||
|
|
||||||
let request = request.into_inner();
|
let request = request.into_inner();
|
||||||
|
global_internode_metrics().record_incoming_request_for_operation(INTERNODE_OPERATION_GRPC_READ_ALL);
|
||||||
if let Some(disk) = self.find_disk(&request.disk).await {
|
if let Some(disk) = self.find_disk(&request.disk).await {
|
||||||
match disk.read_all(&request.volume, &request.path).await {
|
match disk.read_all(&request.volume, &request.path).await {
|
||||||
Ok(data) => {
|
Ok(data) => {
|
||||||
global_internode_metrics().record_incoming_request_for_operation(INTERNODE_OPERATION_GRPC_READ_ALL);
|
|
||||||
global_internode_metrics().record_sent_bytes_for_operation(INTERNODE_OPERATION_GRPC_READ_ALL, data.len());
|
global_internode_metrics().record_sent_bytes_for_operation(INTERNODE_OPERATION_GRPC_READ_ALL, data.len());
|
||||||
Ok(Response::new(ReadAllResponse {
|
Ok(Response::new(ReadAllResponse {
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user