MCPcopy Create free account
hub / github.com/elastic/devfiler / main

Function main

src/main.rs:29–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
28
29fn main() -> anyhow::Result<()> {
30 log::install();
31
32 if std::env::args().any(|x| x == "-v" || x == "--version") {
33 println!("Version: v{}", env!("CARGO_PKG_VERSION"));
34 return Ok(());
35 }
36
37 let rt = tokio::runtime::Runtime::new()?;
38 let _rt_guard = rt.enter(); // make rt avail on main thread
39
40 let collector_addr = "0.0.0.0:11000".parse().unwrap();
41 let collector = collector::Collector::new(collector_addr);
42
43 if std::env::args().any(|x| x == "--collector-only") {
44 rt.block_on(collector.serve())?;
45 } else {
46 let symb_endpoint = std::env::args()
47 .collect::<Vec<String>>()
48 .windows(2)
49 .find(|pair| pair[0] == "--symb-endpoint")
50 .map(|pair| pair[1].clone())
51 .unwrap_or_else(|| String::new());
52
53 rt.spawn(symbolizer::monitor_executables(symb_endpoint));
54 let collector2 = collector.clone();
55 rt.spawn(async move { collector2.serve().await });
56 ui::gui_thread(collector).unwrap();
57 }
58
59 Ok(())
60}

Callers

nothing calls this directly

Calls 5

installFunction · 0.85
monitor_executablesFunction · 0.85
gui_threadFunction · 0.85
serveMethod · 0.80
spawnMethod · 0.80

Tested by

no test coverage detected