-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathapi.proto
57 lines (46 loc) · 1.32 KB
/
api.proto
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
syntax = "proto3";
package server;
option go_package = "github.com/moderato-app/live-pprof/api";
service Metrics {
rpc HeapMetrics(GoMetricsRequest) returns (GoMetricsResponse);
rpc CPUMetrics(GoMetricsRequest) returns (GoMetricsResponse);
rpc AllocsMetrics(GoMetricsRequest) returns (GoMetricsResponse);
rpc GoroutineMetrics(GoMetricsRequest) returns (GoMetricsResponse);
}
// MockMetrics returns mock data instead of real data to save development time
service MockMetrics {
rpc HeapMetrics(GoMetricsRequest) returns (GoMetricsResponse);
rpc CPUMetrics(GoMetricsRequest) returns (GoMetricsResponse);
rpc AllocsMetrics(GoMetricsRequest) returns (GoMetricsResponse);
rpc GoroutineMetrics(GoMetricsRequest) returns (GoMetricsResponse);
}
service General {
rpc DetectURL(DetectURLRequest) returns (stream DetectURLResponse);
}
message GoMetricsRequest {
string url = 1;
}
message GoMetricsResponse {
int64 date = 1;
repeated Item items = 2;
int64 total = 3;
}
message Item {
string func = 1;
string line = 2;
int64 flat = 3 ;
int64 cum = 4;
}
message DetectURLRequest {
string url = 1;
}
message DetectURLResponse {
string endpoint = 1;
optional HTTPResult httpResult = 2;
optional string error = 4;
}
message HTTPResult{
int32 statusCode = 1;
string statusText = 2;
optional string body = 3;
}