diff --git a/src/main.rs b/src/main.rs index d52700c..16ee93b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use actix_web_prom::PrometheusMetrics; use database::{DbError, DbErrorKind, FavoriteDao, SqliteFavoriteDao, SqliteUserDao, UserDao}; use futures::stream::StreamExt; use lazy_static::lazy_static; -use prometheus::{self, Gauge}; +use prometheus::{self, IntGauge}; use std::path::{Path, PathBuf}; use std::sync::mpsc::channel; use std::sync::Arc; @@ -43,12 +43,12 @@ mod files; mod video; lazy_static! { - static ref IMAGE_GAUGE: Gauge = Gauge::new( + static ref IMAGE_GAUGE: IntGauge = IntGauge::new( "imageserver_image_total", "Count of the images on the server" ) .unwrap(); - static ref VIDEO_GAUGE: Gauge = Gauge::new( + static ref VIDEO_GAUGE: IntGauge = IntGauge::new( "imageserver_video_total", "Count of the videos on the server" ) @@ -381,8 +381,8 @@ fn update_media_counts(media_dir: &PathBuf) { } } - IMAGE_GAUGE.set(image_count as f64); - VIDEO_GAUGE.set(video_count as f64); + IMAGE_GAUGE.set(image_count); + VIDEO_GAUGE.set(video_count); } fn is_image(entry: &DirEntry) -> bool {