aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/proto/spark/spark.proto
blob: 200441555547204ffe45385a2d6d8a49ca2a2302 (plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
syntax = "proto3";

package spark;

option java_package = "me.lucko.spark.proto";
option java_outer_classname = "SparkProtos";

message PlatformMetadata {
  Type type = 1;
  string name = 2;
  string version = 3;
  string minecraft_version = 4; // optional
  int32 spark_version = 7;

  // replaced
  reserved 5, 6;
  reserved "n_cpus", "heap_usage";

  enum Type {
    SERVER = 0;
    CLIENT = 1;
    PROXY = 2;
  }
}

message SystemStatistics {
  Cpu cpu = 1;
  Memory memory = 2;
  map<string, Gc> gc = 3;
  Disk disk = 4;
  Os os = 5;
  Java java = 6;
  int64 uptime = 7;
  map<string, NetInterface> net = 8;

  message Cpu {
    int32 threads = 1;
    Usage process_usage = 2;
    Usage system_usage = 3;
    string model_name = 4; // optional

    message Usage {
      double last1m = 1;
      double last15m = 2;
    }
  }

  message Memory {
    MemoryPool physical = 1;
    MemoryPool swap = 2;

    message MemoryPool {
      int64 used = 1;
      int64 total = 2;
    }
  }

  message Gc {
    int64 total = 1;
    double avg_time = 2;
    double avg_frequency = 3;
  }

  message Disk {
    int64 used = 1;
    int64 total = 2;
  }

  message Os {
    string arch = 1;
    string name = 2;
    string version = 3;
  }

  message Java {
    string vendor = 1;
    string version = 2;
    string vendor_version = 3;
    string vm_args = 4;
  }

  message NetInterface {
    RollingAverageValues rx_bytes_per_second = 1;
    RollingAverageValues tx_bytes_per_second = 2;
    RollingAverageValues rx_packets_per_second = 3;
    RollingAverageValues tx_packets_per_second = 4;
  }
}

message PlatformStatistics {
  Memory memory = 1;
  map<string, Gc> gc = 2;
  int64 uptime = 3;
  Tps tps = 4; // optional
  Mspt mspt = 5; // optional
  Ping ping = 6; // optional
  int64 player_count = 7; // optional
  WorldStatistics world = 8; // optional

  message Memory {
    MemoryPool heap = 1;

    message MemoryPool {
      int64 used = 1;
      int64 total = 2;
    }
  }

  message Gc {
    int64 total = 1;
    double avg_time = 2;
    double avg_frequency = 3;
  }

  message Tps {
    double last1m = 1;
    double last5m = 2;
    double last15m = 3;
  }

  message Mspt {
    RollingAverageValues last1m = 1;
    RollingAverageValues last5m = 2;
  }

  message Ping {
    RollingAverageValues last15m = 1;
  }
}

message WorldStatistics {
  int32 total_entities = 1;
  map<string, int32> entity_counts = 2;
  repeated World worlds = 3;

  message World {
    string name = 1;
    int32 total_entities = 2;
    repeated Region regions = 3;
  }

  message Region {
    int32 total_entities = 1;
    repeated Chunk chunks = 2;
  }

  message Chunk {
    int32 x = 1;
    int32 z = 2;
    int32 total_entities = 3;
    map<string, int32> entity_counts = 4;
  }
}

message WindowStatistics {
  int32 ticks = 1;
  double cpu_process = 2;
  double cpu_system = 3;
  double tps = 4;
  double mspt_median = 5;
  double mspt_max = 6;

  // world
  int32 players = 7;
  int32 entities = 8;
  int32 tile_entities = 9;
  int32 chunks = 10;

  // approximate wall-clock start/end times
  int64 start_time = 11;
  int64 end_time = 12;
  int32 duration = 13;
}

message RollingAverageValues {
  double mean = 1;
  double max = 2;
  double min = 3;
  double median = 4;
  double percentile95 = 5;
}

message CommandSenderMetadata {
  Type type = 1;
  string name = 2;
  string unique_id = 3;

  enum Type {
    OTHER = 0;
    PLAYER = 1;
  }
}