all metrics are optional

This commit is contained in:
Robin Appelman 2020-01-27 20:01:47 +01:00
commit 5a566f0197

View file

@ -2,6 +2,7 @@ use err_derive::Error;
use reqwest::Client;
use serde::Deserialize;
use std::cmp::{max, min};
use std::collections::HashMap;
use std::time::SystemTime;
use tokio::time::Duration;
@ -43,18 +44,10 @@ struct QueryResultData {
#[derive(Debug, Clone, Deserialize)]
struct QueryResultDataResult {
metric: QueryResultDataResultMetric,
metric: HashMap<String, String>,
values: Vec<QueryResultDataResultValue>,
}
#[derive(Debug, Clone, Deserialize)]
struct QueryResultDataResultMetric {
#[serde(rename = "__name__")]
id: Option<String>,
instance: String,
job: String,
}
#[derive(Debug, Clone, Deserialize)]
struct QueryResultDataResultValue(u64, String);