From 5d5f3c724435592c3f839642c3fc149f42f81102 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sat, 12 Oct 2019 20:42:41 -0700 Subject: [PATCH] Lint cleanup when prometheus not enabled. --- rtiow/src/bin/tracer.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rtiow/src/bin/tracer.rs b/rtiow/src/bin/tracer.rs index 06a8045..a862134 100644 --- a/rtiow/src/bin/tracer.rs +++ b/rtiow/src/bin/tracer.rs @@ -8,13 +8,13 @@ extern crate rtiow; extern crate stderrlog; extern crate structopt; #[macro_use] +#[cfg(feature = "prom")] extern crate lazy_static; #[macro_use] #[cfg(feature = "prom")] extern crate prometheus; use std::fs; -use std::time::Instant; use chrono::DateTime; use chrono::Utc; @@ -46,7 +46,7 @@ fn push_metrics(_push_gateway_addr: &str, _instance: String, start_time: &DateTi #[cfg(feature = "prom")] fn push_metrics(push_gateway_addr: &str, instance: String, start_time: &DateTime) { - let runtime = start_instant.elapsed(); + let runtime = (Utc::now() - *start_time).to_std().unwrap(); info!( "Render time {}.{} seconds", runtime.as_secs(), @@ -117,7 +117,6 @@ fn main() -> Result<(), std::io::Error> { .init() .unwrap(); let start_time: DateTime = Utc::now(); - let start_instant = Instant::now(); let opt = Opt::from_args(); let scene = opt.model.scene(&opt); fs::create_dir_all(&opt.output)?;