forked from anqin/trident
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuiltin_service.proto
More file actions
130 lines (99 loc) · 3.34 KB
/
builtin_service.proto
File metadata and controls
130 lines (99 loc) · 3.34 KB
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
// Copyright (c) 2014 The Trident Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
//
syntax="proto2";
import "google/protobuf/descriptor.proto";
import "trident/rpc_option.proto";
package trident.builtin;
option cc_generic_services = true;
message HealthRequest {
}
message HealthResponse {
optional string health = 1;
}
message ServerOptions {
optional int64 work_thread_num = 1;
optional int64 keep_alive_time = 2;
optional int64 max_pending_buffer_size = 3;
optional int64 max_throughput_in = 4;
optional int64 max_throughput_out = 5;
optional bool disable_builtin_services = 6;
optional bool disable_list_service = 7;
}
message ServerOptionsRequest {
}
message ServerOptionsResponse {
optional ServerOptions options = 1;
}
// Update server options. Only the following options can be update:
// - keep_alive_time
// - max_pending_buffer_size
// - max_throughput_in
// - max_throughput_out
// If not set, then use old value.
message UpdateOptionsRequest {
optional ServerOptions options = 1;
}
// If succeed, returns new values.
message UpdateOptionsResponse {
optional ServerOptions options = 1;
}
message ServerStatusRequest {
}
message ServerStatusResponse {
optional bool is_listening = 1;
// count of client connections.
optional int64 connection_count = 2;
// count of registered services.
optional int64 service_count = 3;
// total count of pending messages.
optional int64 pending_message_count = 4;
// total size of pending buffers occupied by pending messages.
optional int64 pending_buffer_size = 5;
// total size of pending data in pending messages, may by less than pending_buffer_size.
optional int64 pending_data_size = 6;
}
message ListServiceRequest {
}
message ListServiceResponse {
// full name of all registered services.
repeated string services = 1;
// descriptor of all dependency proto files.
repeated google.protobuf.FileDescriptorProto files = 2;
}
message MethodStat {
optional string method_name = 1;
optional int64 succeed_count = 2;
optional float succeed_avg_time_us = 3;
optional int64 succeed_max_time_us = 4;
optional int64 failed_count = 5;
optional float failed_avg_time_us = 6;
optional int64 failed_max_time_us = 7;
}
message ServiceStat {
optional string service_name = 1;
optional int64 period_seconds = 2;
optional int64 succeed_count = 3;
optional int64 failed_count = 4;
repeated MethodStat method_stats = 5;
}
message StatRequest {
optional string service_name = 1 [default = "all"];
optional int64 period_seconds = 2 [default = 60]; // expect period in seconds
}
message StatResponse {
repeated ServiceStat service_stats = 1;
}
service BuiltinService {
option (trident.service_timeout) = 3000;
rpc Health(HealthRequest) returns (HealthResponse);
rpc ServerOptions(ServerOptionsRequest) returns (ServerOptionsResponse);
rpc UpdateOptions(UpdateOptionsRequest) returns (UpdateOptionsResponse);
rpc ServerStatus(ServerStatusRequest) returns (ServerStatusResponse);
rpc ListService(ListServiceRequest) returns (ListServiceResponse) {
option (trident.response_compress_type) = CompressTypeGzip;
}
rpc Stat(StatRequest) returns (StatResponse);
}