Compare commits
1 Commits
2a4cc4b2d5
...
v0.1.32
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d6b5165c1 |
@@ -430,7 +430,7 @@ pub async fn send_docker_metrics(
|
||||
) -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
let client = Client::new();
|
||||
let url = format!("{}/monitoring/docker-metric", base_url);
|
||||
|
||||
|
||||
println!("Docker Metrics: {}", serde_json::to_string_pretty(&docker_metrics)?);
|
||||
|
||||
match client.post(&url).json(&docker_metrics).send().await {
|
||||
|
||||
@@ -238,7 +238,7 @@ impl DockerManager {
|
||||
let container_infos: Vec<DockerCollectMetricDto> = container_infos_total
|
||||
.into_iter()
|
||||
.filter_map(|info| {
|
||||
let container = match info.container {
|
||||
let _container = match info.container {
|
||||
Some(c) => c,
|
||||
None => {
|
||||
eprintln!("Warning: Container info missing container data, skipping");
|
||||
@@ -286,7 +286,7 @@ impl DockerManager {
|
||||
};
|
||||
|
||||
Some(DockerCollectMetricDto {
|
||||
id: container.id,
|
||||
server_id: 0,
|
||||
status: status_dto,
|
||||
cpu: cpu_dto,
|
||||
ram: ram_dto,
|
||||
|
||||
@@ -160,7 +160,7 @@ pub struct ServerMessage {
|
||||
// Define your message structure here
|
||||
pub message_type: String,
|
||||
pub data: serde_json::Value,
|
||||
pub message_id: String, // Add an ID for acknowledgment
|
||||
pub message_id: String,
|
||||
}
|
||||
|
||||
/// Acknowledgment payload sent to the backend server for command messages.
|
||||
@@ -225,7 +225,7 @@ pub struct DockerMetricDto {
|
||||
#[derive(Debug, Serialize, Clone)]
|
||||
|
||||
pub struct DockerCollectMetricDto {
|
||||
pub id: String,
|
||||
pub server_id: u16,
|
||||
pub status: DockerContainerStatusDto,
|
||||
pub cpu: DockerContainerCpuDto,
|
||||
pub ram: DockerContainerRamDto,
|
||||
|
||||
Reference in New Issue
Block a user