pub struct MatrixResult {
pub labels: HashMap<String, String>,
pub values: Vec<Vec<Value>>,
}
Expand description
MatrixResult
contains Prometheus Range Vectors
let matrix_raw_response = hyper::body::Bytes::from(r#"
{
"metric": {
"__name__": "node_load1",
"instance": "localhost:9100",
"job": "node_exporter"
},
"values": [
[1558253469,"1.69"],[1558253470,"1.70"],[1558253471,"1.71"]
]
}"#);
let res_json: Result<prometheus_http_api::MatrixResult, serde_json::Error> = serde_json::from_slice(&matrix_raw_response);
assert!(res_json.is_ok());
Fields§
§labels: HashMap<String, String>
A series of labels for the matrix results. This is a HashMap of {"label_name_1": "value_1", ...}
values: Vec<Vec<Value>>
The values over time captured on prometheus, generally [[<epoch>, "<value>"]]
Trait Implementations§
Source§impl Clone for MatrixResult
impl Clone for MatrixResult
Source§fn clone(&self) -> MatrixResult
fn clone(&self) -> MatrixResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MatrixResult
impl Debug for MatrixResult
Source§impl Default for MatrixResult
impl Default for MatrixResult
Source§fn default() -> MatrixResult
fn default() -> MatrixResult
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MatrixResult
impl<'de> Deserialize<'de> for MatrixResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MatrixResult
impl PartialEq for MatrixResult
Source§impl Serialize for MatrixResult
impl Serialize for MatrixResult
impl StructuralPartialEq for MatrixResult
Auto Trait Implementations§
impl Freeze for MatrixResult
impl RefUnwindSafe for MatrixResult
impl Send for MatrixResult
impl Sync for MatrixResult
impl Unpin for MatrixResult
impl UnwindSafe for MatrixResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more