Proxy: value: handle i64/f64/string
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
parent
0c96891a46
commit
dcce9113d1
1 changed files with 10 additions and 2 deletions
12
src/main.rs
12
src/main.rs
|
@ -19,11 +19,19 @@ struct QSParams {
|
|||
token: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(untagged)]
|
||||
enum OtsdbValue {
|
||||
String(String),
|
||||
Integer(i64),
|
||||
Float(f64),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
struct OtsdbData {
|
||||
metric: String,
|
||||
value: String,
|
||||
timestamp: f64,
|
||||
value: OtsdbValue,
|
||||
timestamp: i64,
|
||||
tags: HashMap<String, String>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue