mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 15:57:09 +00:00
dragonball: add metrics system
metrics system is added for collecting Dragonball metrics to analyze the system. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com> Signed-off-by: jingshan <jingshan@linux.alibaba.com> Signed-off-by: Chao Wu <chaowu@linux.alibaba.com> Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
This commit is contained in:
parent
e80e0c4645
commit
b6cb2c4ae3
@ -22,6 +22,7 @@ dbs-utils = "0.1.0"
|
||||
dbs-virtio-devices = { version = "0.1.0", optional = true, features = ["virtio-mmio"] }
|
||||
kvm-bindings = "0.5.0"
|
||||
kvm-ioctls = "0.11.0"
|
||||
lazy_static = "1.2"
|
||||
libc = "0.2.39"
|
||||
linux-loader = "0.4.0"
|
||||
log = "0.4.14"
|
||||
|
@ -17,6 +17,8 @@ pub mod config_manager;
|
||||
pub mod device_manager;
|
||||
/// Errors related to Virtual machine manager.
|
||||
pub mod error;
|
||||
/// Metrics system.
|
||||
pub mod metric;
|
||||
/// Resource manager for virtual machines.
|
||||
pub mod resource_manager;
|
||||
/// Virtual machine manager for virtual machines.
|
||||
|
39
src/dragonball/src/metric.rs
Normal file
39
src/dragonball/src/metric.rs
Normal file
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2022 Alibaba Cloud. All rights reserved.
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use dbs_utils::metric::SharedIncMetric;
|
||||
use lazy_static::lazy_static;
|
||||
use serde::Serialize;
|
||||
|
||||
pub use dbs_utils::metric::IncMetric;
|
||||
|
||||
lazy_static! {
|
||||
/// Static instance used for handling metrics.
|
||||
pub static ref METRICS: DragonballMetrics = DragonballMetrics::default();
|
||||
}
|
||||
|
||||
/// Metrics for the seccomp filtering.
|
||||
#[derive(Default, Serialize)]
|
||||
pub struct SeccompMetrics {
|
||||
/// Number of errors inside the seccomp filtering.
|
||||
pub num_faults: SharedIncMetric,
|
||||
}
|
||||
|
||||
/// Metrics related to signals.
|
||||
#[derive(Default, Serialize)]
|
||||
pub struct SignalMetrics {
|
||||
/// Number of times that SIGBUS was handled.
|
||||
pub sigbus: SharedIncMetric,
|
||||
/// Number of times that SIGSEGV was handled.
|
||||
pub sigsegv: SharedIncMetric,
|
||||
}
|
||||
|
||||
/// Structure storing all metrics while enforcing serialization support on them.
|
||||
#[derive(Default, Serialize)]
|
||||
pub struct DragonballMetrics {
|
||||
/// Metrics related to seccomp filtering.
|
||||
pub seccomp: SeccompMetrics,
|
||||
/// Metrics related to signals.
|
||||
pub signals: SignalMetrics,
|
||||
}
|
Loading…
Reference in New Issue
Block a user