1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Namespace: "keybase.1"
// Protocol: "NotifyRuntimeStats"
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Serialize, Deserialize};
use serde_repr::{Deserialize_repr, Serialize_repr};use super::*;

use super::common::*;
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum StatsSeverityLevel {
  Normal_0,
  Warning_1,
  Severe_2,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct DbStats {
  #[serde(rename = "type")]
  pub ty: Option<DbType>,
  #[serde(default)]
  pub memCompActive: Option<bool>,
  #[serde(default)]
  pub tableCompActive: Option<bool>,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ProcessType {
  Main_0,
  Kbfs_1,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ProcessRuntimeStats {
  #[serde(rename = "type")]
  pub ty: Option<ProcessType>,
  #[serde(default)]
  pub cpu: Option<String>,
  #[serde(default)]
  pub resident: Option<String>,
  #[serde(default)]
  pub virt: Option<String>,
  #[serde(default)]
  pub free: Option<String>,
  #[serde(default)]
  pub goheap: Option<String>,
  #[serde(default)]
  pub goheapsys: Option<String>,
  #[serde(default)]
  pub goreleased: Option<String>,
  pub cpuSeverity: Option<StatsSeverityLevel>,
  pub residentSeverity: Option<StatsSeverityLevel>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct RuntimeStats {
  #[serde(default)]
  pub processStats: Option<Vec<ProcessRuntimeStats>>,
  #[serde(default)]
  pub dbStats: Option<Vec<DbStats>>,
  #[serde(default)]
  pub convLoaderActive: Option<bool>,
  #[serde(default)]
  pub selectiveSyncActive: Option<bool>,
}