Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

address earlier pr comments

+7 -13
+1 -1
slingshot/src/server.rs
··· 755 755 ) 756 756 .await 757 757 } else { 758 - run(TcpListener::bind(bind.to_string()), app, shutdown).await 758 + run(TcpListener::bind(bind), app, shutdown).await 759 759 } 760 760 } 761 761
+3 -6
spacedust/src/main.rs
··· 138 138 } 139 139 140 140 fn install_metrics_server( 141 - bind_metrics: std::net::SocketAddr, 141 + bind: std::net::SocketAddr, 142 142 ) -> Result<(), metrics_exporter_prometheus::BuildError> { 143 143 log::info!("installing metrics server..."); 144 144 PrometheusBuilder::new() ··· 146 146 .set_bucket_duration(std::time::Duration::from_secs(300))? 147 147 .set_bucket_count(std::num::NonZero::new(12).unwrap()) // count * duration = 60 mins. stuff doesn't happen that fast here. 148 148 .set_enable_unit_suffix(false) // this seemed buggy for constellation (sometimes wouldn't engage) 149 - .with_http_listener(bind_metrics) 149 + .with_http_listener(bind) 150 150 .install()?; 151 - log::info!( 152 - "metrics server installed! listening on http://{}", 153 - bind_metrics 154 - ); 151 + log::info!("metrics server installed! listening on {bind}"); 155 152 Ok(()) 156 153 }
+3 -6
ufos/src/main.rs
··· 165 165 Ok(()) 166 166 } 167 167 168 - fn install_metrics_server(bind_metrics: std::net::SocketAddr) -> anyhow::Result<()> { 168 + fn install_metrics_server(bind: std::net::SocketAddr) -> anyhow::Result<()> { 169 169 log::info!("installing metrics server..."); 170 170 PrometheusBuilder::new() 171 171 .set_quantiles(&[0.5, 0.9, 0.99, 1.0])? 172 172 .set_bucket_duration(Duration::from_secs(60))? 173 173 .set_bucket_count(std::num::NonZero::new(10).unwrap()) // count * duration = 10 mins. stuff doesn't happen that fast here. 174 174 .set_enable_unit_suffix(false) // this seemed buggy for constellation (sometimes wouldn't engage) 175 - .with_http_listener(bind_metrics) 175 + .with_http_listener(bind) 176 176 .install()?; 177 - log::info!( 178 - "metrics server installed! listening on http://{}", 179 - bind_metrics 180 - ); 177 + log::info!("metrics server installed! listening on {bind}"); 181 178 Ok(()) 182 179 } 183 180