-
Notifications
You must be signed in to change notification settings - Fork 0
/
beacon.proto
75 lines (57 loc) · 1.8 KB
/
beacon.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
syntax = "proto3";
package beacon;
// placeholder message
message Empty {}
// Authorization request message
message AuthRequest {
// The Beacon API key for the team or user account
// This is auto-generated by DeepSource
string beacon_api_key = 1;
// The unique repository identifier for this application
// This is auto-generated by DeepSource
int64 repository_id = 2;
// Version of the Beacon client sending this message
string beacon_client_version = 3;
// Source version of the application
// This could be a version control string, like Git's SHA
string source_version = 4;
// Host's name where the application is running
string hostname = 5;
}
// Authorization response message
message AuthResponse {
// The unique stream identifier for an established stream
string stream_id = 1;
}
// An individual event's frequency aggregation
message Event {
// The relative path of the file where this event occurred
string file_path = 1;
// The location in the file where the event occurred
int64 location = 2;
// Count of these events, aggregated over a time period
int64 count = 3;
}
// A batch of events sent to Beacon server
message Batch {
// The stream_id that is returned after the authentication
string stream_id = 1;
// Type of events in this batch
enum Type {
f = 0; // a function call
e = 1; // an exception
}
Type event_type = 2;
// list of events that are to be sent in this batch
repeated Event events = 3;
// Unix timestamp, denoting the start time of the
// first tracked event in this batch
// Ex: 1542616942
int64 timestamp = 4;
}
service Beacon {
// make an initialization request for transmission
rpc InitializeStream (AuthRequest) returns (AuthResponse) {}
// flush a batch to the server
rpc Transmit (Batch) returns (Empty) {}
}