-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathprofile.graphqls
178 lines (161 loc) · 5.26 KB
/
profile.graphqls
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Profile task create need data
input ProfileTaskCreationRequest {
# need to monitor service id
serviceId: ID!
# endpoint name to monitored under the special service.
endpointName: String!
# if null means the task starts ASAP, otherwise the task begin after the startTime(based on agent side time)
startTime: Long
# duration of this task (minute)
duration: Int!
# when the segment starts to execute, how long must it take before the monitor can be enbaled
minDurationThreshold: Int!
# when start monitor, time interval for each dumping the stack
dumpPeriod: Int!
# max number of traces will monitor on the sniffer
maxSamplingCount: Int!
}
# Profile task create result
type ProfileTaskCreationResult {
# if null or empty means the task create success, otherwise get create error reason
errorReason: String
# get data id when create success
id: String
}
# Profile task log operation type
enum ProfileTaskLogOperationType {
# when sniffer has notified
NOTIFIED,
# when sniffer has execution finished to report
EXECUTION_FINISHED
}
# Profile task execute log
type ProfileTaskLog {
id: String!
# execute instance
instanceId: ID!
instanceName: String!
# operation type
operationType: ProfileTaskLogOperationType!
# operation time
operationTime: Long!
}
# Profile
type ProfileTask {
id: String!
# monitor service
serviceId: ID!
serviceName: String!
# endpoint name to monitored under the special service.
endpointName: String!
# task start time (timestamp)
startTime: Long!
# duration of this task (minute)
duration: Int!
# when the segment starts to execute, how long must it take before the monitor can be enbaled
minDurationThreshold: Int!
# when start monitor, time interval for each dumping the stack
dumpPeriod: Int!
# max number of traces will monitor on the sniffer
maxSamplingCount: Int!
# instance operation logs
logs: [ProfileTaskLog!]!
}
# Profile thread stack analyze tree element
type ProfileStackElement {
# work for tree building, id matches multiple parentId
id: ID!
parentId: ID!
# stack code signature
codeSignature: String!
# Include the execution time of children(millisecond)
duration: Int!
# Exclude the execution time of children(millisecond)
durationChildExcluded: Int!
# continuous dump count
count: Int!
}
# Profile thread stack anayze tree
type ProfileStackTree {
elements: [ProfileStackElement!]!
}
# Profile analyze result
type ProfileAnalyzation {
# if not empty means backend has information gave to the user
# such as: a large number of snapshots, only analyze part of the data
tip: String
# thread stack dump analyze trees
trees: [ProfileStackTree!]!
}
type ProfiledSpan {
spanId: Int!
parentSpanId: Int!
segmentId: ID!
refs: [Ref!]!
serviceCode: String!
serviceInstanceName: ID!
startTime: Long!
endTime: Long!
endpointName: String
# There are three span types: Local, Entry and Exit
type: String!
# Peer network id, e.g. host+port, ip+port
peer: String
component: String
isError: Boolean
# There are 5 layers: Unknown, Database, RPCFramework, Http, MQ and Cache
layer: String
tags: [KeyValue!]!
logs: [LogEntity!]!
# Status represents profiling data that covers the duration of the span.
profiled: Boolean!
}
type ProfiledSegment {
spans: [ProfiledSpan!]!
}
input ProfileAnalyzeTimeRange {
start: Long!
end: Long!
}
type ProfiledTraceSegments {
traceId: String!
instanceId: ID!
instanceName: String!
endpointNames: [String!]!
duration: Int!
start: String!
spans: [ProfiledSpan!]!
}
input SegmentProfileAnalyzeQuery {
segmentId: String!
timeRange: ProfileAnalyzeTimeRange!
}
extend type Mutation {
# crate new profile task
createProfileTask(creationRequest: ProfileTaskCreationRequest): ProfileTaskCreationResult!
}
extend type Query {
# query all task list, order by ProfileTask#startTime descending
getProfileTaskList(serviceId: ID, endpointName: String): [ProfileTask!]!
# query all task logs
getProfileTaskLogs(taskID: String): [ProfileTaskLog!]!
# query all task profiled segment list
getProfileTaskSegments(taskID: ID!): [ProfiledTraceSegments!]!
# analyze multiple profiled segments, start and end time use timestamp(millisecond)
getSegmentsProfileAnalyze(queries: [SegmentProfileAnalyzeQuery!]!): ProfileAnalyzation!
}