• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2021 Huawei Device Co., Ltd.
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6//     http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14syntax = "proto3";
15
16option java_package = "ohos.devtools.datasources.transport.grpc.service";
17option optimize_for = LITE_RUNTIME;
18
19message HttpRequestHead {
20    string url = 1;
21    string method = 2;
22    string fields = 3;
23    string trace = 4;
24}
25
26message HttpResponseHead {
27    string fields = 1;
28}
29
30message HttpBody {
31    string payload_id = 1;
32    int32 payload_size = 2;
33    bytes payload_fields = 3;
34}
35
36message HttpEndStatus {
37    bool aborted = 1;
38}
39
40// thread
41message AgentThread {
42    int64 id = 1;
43    string name = 2;
44}
45
46message AgentNetworkEvent {
47    // timestamp obtained by CLOCK_REALTIME
48    uint64 tv_sec = 1;
49    uint64 tv_nsec = 2;
50    int64 event_id = 3;
51
52    oneof event {
53        HttpRequestHead request_head = 4;
54        HttpResponseHead response_head = 5;
55        HttpBody request_body = 6;
56        HttpBody response_body = 7;
57        HttpEndStatus end_status = 8;
58        AgentThread agent_thread = 9;
59    }
60}
61
62message BatchAgentNetworkEvent {
63    repeated AgentNetworkEvent events = 1;
64}