Alexey Velikiy
3 years ago
5 changed files with 51 additions and 12 deletions
@ -1 +1 @@ |
|||||||
VUE_APP_API_URL="http://localhost:8000/api/" |
VUE_APP_API_URL="http://localhost:8000/api/" |
||||||
|
@ -1 +1 @@ |
|||||||
VUE_APP_API_URL="/api/" |
VUE_APP_API_URL="/api/" |
||||||
|
@ -1,13 +1,19 @@ |
|||||||
use subbeat::datasources::prometheus::Prometheus; |
use subbeat::datasources::prometheus::Prometheus; |
||||||
|
|
||||||
pub struct MetricService { |
pub struct MetricService { |
||||||
prom: Prometheus, |
url: String, |
||||||
|
query: String, |
||||||
} |
} |
||||||
|
|
||||||
impl MetricService { |
impl MetricService { |
||||||
pub fn new(url: &str, query: &str) -> MetricService { |
pub fn new(url: &str, query: &str) -> MetricService { |
||||||
MetricService { |
MetricService { |
||||||
prom: Prometheus::new(&url.to_string(), &query.to_string()), |
url: url.to_string(), |
||||||
|
query: url.to_string(), |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
pub fn get_prom(&self) -> Prometheus { |
||||||
|
Prometheus::new(&self.url.to_string(), &self.query.to_string()) |
||||||
|
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue