aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/proto
diff options
context:
space:
mode:
Diffstat (limited to 'spark-common/src/main/proto')
-rw-r--r--spark-common/src/main/proto/spark/spark.proto5
-rw-r--r--spark-common/src/main/proto/spark/spark_sampler.proto12
-rw-r--r--spark-common/src/main/proto/spark/spark_ws.proto78
3 files changed, 95 insertions, 0 deletions
diff --git a/spark-common/src/main/proto/spark/spark.proto b/spark-common/src/main/proto/spark/spark.proto
index f61e585..2004415 100644
--- a/spark-common/src/main/proto/spark/spark.proto
+++ b/spark-common/src/main/proto/spark/spark.proto
@@ -165,6 +165,11 @@ message WindowStatistics {
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 {
diff --git a/spark-common/src/main/proto/spark/spark_sampler.proto b/spark-common/src/main/proto/spark/spark_sampler.proto
index 245da37..dbc336a 100644
--- a/spark-common/src/main/proto/spark/spark_sampler.proto
+++ b/spark-common/src/main/proto/spark/spark_sampler.proto
@@ -15,6 +15,7 @@ message SamplerData {
map<string, string> line_sources = 5; // optional
repeated int32 time_windows = 6;
map<int32, WindowStatistics> time_window_statistics = 7;
+ SocketChannelInfo channel_info = 8;
}
message SamplerMetadata {
@@ -32,6 +33,7 @@ message SamplerMetadata {
int32 number_of_ticks = 12;
map<string, SourceMetadata> sources = 13;
map<string, string> extra_platform_metadata = 14;
+ SamplerMode sampler_mode = 15;
message ThreadDumper {
Type type = 1;
@@ -67,6 +69,11 @@ message SamplerMetadata {
string name = 1;
string version = 2;
}
+
+ enum SamplerMode {
+ EXECUTION = 0;
+ ALLOCATION = 1;
+ }
}
message ThreadNode {
@@ -94,3 +101,8 @@ message StackTraceNode {
repeated double times = 8;
repeated int32 children_refs = 9;
}
+
+message SocketChannelInfo {
+ string channel_id = 1;
+ bytes public_key = 2;
+}
diff --git a/spark-common/src/main/proto/spark/spark_ws.proto b/spark-common/src/main/proto/spark/spark_ws.proto
new file mode 100644
index 0000000..97b5480
--- /dev/null
+++ b/spark-common/src/main/proto/spark/spark_ws.proto
@@ -0,0 +1,78 @@
+syntax = "proto3";
+
+package spark;
+
+import "spark/spark.proto";
+import "spark/spark_sampler.proto";
+
+option java_package = "me.lucko.spark.proto";
+option java_outer_classname = "SparkWebSocketProtos";
+
+message RawPacket {
+ int32 version = 1;
+ bytes public_key = 2;
+ bytes signature = 3;
+ bytes message = 4;
+}
+
+message PacketWrapper {
+ oneof packet {
+ // server -> client
+ ServerPong server_pong = 1;
+ ServerConnectResponse server_connect_response = 2;
+ ServerUpdateSamplerData server_update_sampler = 3;
+ ServerUpdateStatistics server_update_statistics = 4;
+
+ // client -> server
+ ClientPing client_ping = 10;
+ ClientConnect client_connect = 11;
+ }
+}
+
+// (signed) Sent from the server -> client in response to a ping
+message ServerPong {
+ bool ok = 1;
+ int32 data = 2;
+}
+
+// (signed) Sent from the server -> client in response to a connection request
+message ServerConnectResponse {
+ string client_id = 1;
+ State state = 2;
+ Settings settings = 3;
+ string last_payload_id = 4;
+
+ enum State {
+ ACCEPTED = 0;
+ UNTRUSTED = 1;
+ REJECTED = 2;
+ }
+
+ message Settings {
+ int32 statistics_interval = 1;
+ int32 sampler_interval = 2;
+ }
+}
+
+// (signed) Sent from the server -> client when there is new sampler data
+message ServerUpdateSamplerData {
+ string payload_id = 1;
+}
+
+// (signed) Sent from the server -> client periodically to update statistics shown in widgets
+message ServerUpdateStatistics {
+ PlatformStatistics platform = 1;
+ SystemStatistics system = 2;
+}
+
+// (unsigned) Sent from the client -> server on initial connection
+message ClientConnect {
+ string client_id = 1;
+ string description = 2;
+}
+
+// (unsigned) Sent from the client -> server to check for responsiveness
+message ClientPing {
+ bool ok = 1;
+ int32 data = 2;
+}