below_ethtool/
types.rs

1// Copyright (c) Facebook, Inc. and its affiliates.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use std::collections::BTreeMap;
16
17use serde::Deserialize;
18use serde::Serialize;
19
20#[derive(Default, Clone, PartialEq, Debug, Serialize, Deserialize)]
21pub struct EthtoolStats {
22    pub nic: BTreeMap<String, NicStats>,
23}
24
25#[derive(Default, Clone, PartialEq, Debug, Serialize, Deserialize)]
26pub struct NicStats {
27    pub queue: Vec<QueueStats>,
28    pub tx_timeout: Option<u64>,
29    pub raw_stats: BTreeMap<String, u64>,
30}
31
32#[derive(Default, Clone, PartialEq, Debug, Serialize, Deserialize)]
33pub struct QueueStats {
34    pub rx_bytes: Option<u64>,
35    pub tx_bytes: Option<u64>,
36    pub rx_count: Option<u64>,
37    pub tx_count: Option<u64>,
38    pub tx_missed_tx: Option<u64>,
39    pub tx_unmask_interrupt: Option<u64>,
40    pub raw_stats: BTreeMap<String, u64>,
41}