aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/proto/spark
diff options
context:
space:
mode:
Diffstat (limited to 'spark-common/src/main/proto/spark')
-rw-r--r--spark-common/src/main/proto/spark/spark.proto176
-rw-r--r--spark-common/src/main/proto/spark/spark_heap.proto27
-rw-r--r--spark-common/src/main/proto/spark/spark_sampler.proto71
3 files changed, 192 insertions, 82 deletions
diff --git a/spark-common/src/main/proto/spark/spark.proto b/spark-common/src/main/proto/spark/spark.proto
index 4305a51..b4f9efb 100644
--- a/spark-common/src/main/proto/spark/spark.proto
+++ b/spark-common/src/main/proto/spark/spark.proto
@@ -5,34 +5,17 @@ package spark;
option java_package = "me.lucko.spark.proto";
option java_outer_classname = "SparkProtos";
-message CommandSenderMetadata {
- Type type = 1;
- string name = 2;
- string unique_id = 3;
-
- enum Type {
- OTHER = 0;
- PLAYER = 1;
- }
-}
-
-message MemoryUsage {
- int64 used = 1;
- int64 committed = 2;
- int64 max = 3;
-}
-
message PlatformMetadata {
Type type = 1;
string name = 2;
string version = 3;
string minecraft_version = 4; // optional
-
- int32 n_cpus = 5;
- MemoryUsage heapUsage = 6;
-
int32 spark_version = 7;
+ // replaced
+ reserved 5, 6;
+ reserved "n_cpus", "heap_usage";
+
enum Type {
SERVER = 0;
CLIENT = 1;
@@ -40,80 +23,109 @@ message PlatformMetadata {
}
}
-message HeapData {
- HeapMetadata metadata = 1;
- repeated HeapEntry entries = 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;
+
+ message Cpu {
+ int32 threads = 1;
+ Usage process_usage = 2;
+ Usage system_usage = 3;
+
+ message Usage {
+ double last1m = 1;
+ double last15m = 2;
+ }
+ }
-message HeapMetadata {
- CommandSenderMetadata creator = 1;
- PlatformMetadata platform_metadata = 2;
-}
+ message Memory {
+ MemoryPool physical = 1;
+ MemoryPool swap = 2;
-message HeapEntry {
- int32 order = 1;
- int32 instances = 2;
- int64 size = 3;
- string type = 4;
-}
+ message MemoryPool {
+ int64 used = 1;
+ int64 total = 2;
+ }
+ }
-message SamplerData {
- SamplerMetadata metadata = 1;
- repeated ThreadNode threads = 2;
- map<string, string> class_sources = 3; // optional
+ 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;
+ }
}
-message SamplerMetadata {
- CommandSenderMetadata creator = 1;
- int64 start_time = 2;
- int32 interval = 3;
- ThreadDumper thread_dumper = 4;
- DataAggregator data_aggregator = 5;
- string comment = 6;
- PlatformMetadata platform_metadata = 7;
-
- message ThreadDumper {
- Type type = 1;
- repeated int64 ids = 2; // optional
- repeated string patterns = 3; // optional
-
- enum Type {
- ALL = 0;
- SPECIFIC = 1;
- REGEX = 2;
+message PlatformStatistics {
+ Memory memory = 1;
+ map<string, Gc> gc = 2;
+ int64 uptime = 3;
+ Tps tps = 4; // optional
+ Mspt mspt = 5; // optional
+
+ message Memory {
+ MemoryPool heap = 1;
+
+ message MemoryPool {
+ int64 used = 1;
+ int64 total = 2;
}
}
- message DataAggregator {
- Type type = 1;
- ThreadGrouper thread_grouper = 2;
- int64 tick_length_threshold = 3; // optional
+ message Gc {
+ int64 total = 1;
+ double avg_time = 2;
+ double avg_frequency = 3;
+ }
- enum Type {
- SIMPLE = 0;
- TICKED = 1;
- }
+ message Tps {
+ double last1m = 1;
+ double last5m = 2;
+ double last15m = 3;
+ }
+
+ message Mspt {
+ Values last1m = 1;
+ Values last5m = 2;
- enum ThreadGrouper {
- BY_NAME = 0;
- BY_POOL = 1;
- AS_ONE = 2;
+ message Values {
+ double mean = 1;
+ double max = 2;
+ double min = 3;
+ double median = 4;
+ double percentile95 = 5;
}
}
}
-message StackTraceNode {
- double time = 1;
- repeated StackTraceNode children = 2;
- string class_name = 3;
- string method_name = 4;
- int32 parent_line_number = 5; // optional
- int32 line_number = 6; // optional
- string method_desc = 7; // optional
-}
+message CommandSenderMetadata {
+ Type type = 1;
+ string name = 2;
+ string unique_id = 3;
-message ThreadNode {
- string name = 1;
- double time = 2;
- repeated StackTraceNode children = 3;
+ enum Type {
+ OTHER = 0;
+ PLAYER = 1;
+ }
}
diff --git a/spark-common/src/main/proto/spark/spark_heap.proto b/spark-common/src/main/proto/spark/spark_heap.proto
new file mode 100644
index 0000000..59f2b85
--- /dev/null
+++ b/spark-common/src/main/proto/spark/spark_heap.proto
@@ -0,0 +1,27 @@
+syntax = "proto3";
+
+package spark;
+
+import "spark/spark.proto";
+
+option java_package = "me.lucko.spark.proto";
+option java_outer_classname = "SparkHeapProtos";
+
+message HeapData {
+ HeapMetadata metadata = 1;
+ repeated HeapEntry entries = 2;
+}
+
+message HeapMetadata {
+ CommandSenderMetadata creator = 1;
+ PlatformMetadata platform_metadata = 2;
+ PlatformStatistics platform_statistics = 3;
+ SystemStatistics system_statistics = 4;
+}
+
+message HeapEntry {
+ int32 order = 1;
+ int32 instances = 2;
+ int64 size = 3;
+ string type = 4;
+}
diff --git a/spark-common/src/main/proto/spark/spark_sampler.proto b/spark-common/src/main/proto/spark/spark_sampler.proto
new file mode 100644
index 0000000..c7cecc3
--- /dev/null
+++ b/spark-common/src/main/proto/spark/spark_sampler.proto
@@ -0,0 +1,71 @@
+syntax = "proto3";
+
+package spark;
+
+import "spark/spark.proto";
+
+option java_package = "me.lucko.spark.proto";
+option java_outer_classname = "SparkSamplerProtos";
+
+message SamplerData {
+ SamplerMetadata metadata = 1;
+ repeated ThreadNode threads = 2;
+ map<string, string> class_sources = 3; // optional
+}
+
+message SamplerMetadata {
+ CommandSenderMetadata creator = 1;
+ int64 start_time = 2;
+ int32 interval = 3;
+ ThreadDumper thread_dumper = 4;
+ DataAggregator data_aggregator = 5;
+ string comment = 6;
+ PlatformMetadata platform_metadata = 7;
+ PlatformStatistics platform_statistics = 8;
+ SystemStatistics system_statistics = 9;
+
+ message ThreadDumper {
+ Type type = 1;
+ repeated int64 ids = 2; // optional
+ repeated string patterns = 3; // optional
+
+ enum Type {
+ ALL = 0;
+ SPECIFIC = 1;
+ REGEX = 2;
+ }
+ }
+
+ message DataAggregator {
+ Type type = 1;
+ ThreadGrouper thread_grouper = 2;
+ int64 tick_length_threshold = 3; // optional
+
+ enum Type {
+ SIMPLE = 0;
+ TICKED = 1;
+ }
+
+ enum ThreadGrouper {
+ BY_NAME = 0;
+ BY_POOL = 1;
+ AS_ONE = 2;
+ }
+ }
+}
+
+message ThreadNode {
+ string name = 1;
+ double time = 2;
+ repeated StackTraceNode children = 3;
+}
+
+message StackTraceNode {
+ double time = 1;
+ repeated StackTraceNode children = 2;
+ string class_name = 3;
+ string method_name = 4;
+ int32 parent_line_number = 5; // optional
+ int32 line_number = 6; // optional
+ string method_desc = 7; // optional
+}