LCOV - differential code coverage report
Current view: top level - libs/vm_monitor/src/bin - monitor.rs (source / functions) Coverage Total Hit UBC
Current: f6946e90941b557c917ac98cd5a7e9506d180f3e.info Lines: 0.0 % 17 0 17
Current Date: 2023-10-19 02:04:12 Functions: 0.0 % 2 0 2
Baseline: c8637f37369098875162f194f92736355783b050.info
Baseline Date: 2023-10-18 20:25:20

           TLA  Line data    Source code
       1                 : // We expose a standalone binary _and_ start the monitor in `compute_ctl` so that
       2                 : // we can test the monitor as part of the entire autoscaling system in
       3                 : // neondatabase/autoscaling.
       4                 : //
       5                 : // The monitor was previously started by vm-builder, and for testing purposes,
       6                 : // we can mimic that setup with this binary.
       7                 : 
       8                 : #[cfg(target_os = "linux")]
       9                 : #[tokio::main]
      10 UBC           0 : async fn main() -> anyhow::Result<()> {
      11               0 :     use clap::Parser;
      12               0 :     use tokio_util::sync::CancellationToken;
      13               0 :     use tracing_subscriber::EnvFilter;
      14               0 :     use vm_monitor::Args;
      15               0 : 
      16               0 :     let subscriber = tracing_subscriber::fmt::Subscriber::builder()
      17               0 :         .json()
      18               0 :         .with_file(true)
      19               0 :         .with_line_number(true)
      20               0 :         .with_span_list(true)
      21               0 :         .with_env_filter(EnvFilter::from_default_env())
      22               0 :         .finish();
      23               0 :     tracing::subscriber::set_global_default(subscriber)?;
      24                 : 
      25               0 :     let args: &'static Args = Box::leak(Box::new(Args::parse()));
      26               0 :     let token = CancellationToken::new();
      27               0 :     vm_monitor::start(args, token).await
      28                 : }
      29                 : 
      30                 : #[cfg(not(target_os = "linux"))]
      31                 : fn main() {
      32                 :     panic!("the monitor requires cgroups, which are only available on linux")
      33                 : }
        

Generated by: LCOV version 2.1-beta