blob: 49e02c89490d472e9d465dbf89f987e96af11abd [file] [log] [blame]
# 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.
# The creation request of eBPF profiling fixed time task
input EBPFProfilingTaskFixedTimeCreationRequest {
# define which processes under the service need to be profiling
serviceId: String!
# aggregate which processes need to be profiling from labels
processLabels: [String!]!
# the task start timestamp(ms), if less then or equal zero means the task starts ASAP
startTime: Long!
# the profiling duration(s)
duration: Int!
# the task profiling target type
targetType: EBPFProfilingTargetType!
}
# eBPF Profiling task creation result
type EBPFProfilingTaskCreationResult {
# TRUE if the task is created successfully
status: Boolean!
# error reason when status == FALSE
errorReason: String
# The task ID when status = TRUE
id: String
}
# eBPF profiling task data
type EBPFProfilingTask {
# profiling task ID
taskId: ID!
# service of profiling task
serviceId: ID!
serviceName: String!
# process labels for filter
processLabels: [String!]!
# Start time of the task, type is timestamp.
taskStartTime: Long!
# profiling task trigger type
triggerType: EBPFProfilingTriggerType!
# "FIXED_TIME" type task profiling duration
fixedTriggerDuration: Long
# profiling task target type
targetType: EBPFProfilingTargetType!
# the timestamp of creating this task
createTime: Long!
}
type EBPFProfilingSchedule {
# profiling task schedule ID
scheduleId: ID!
# profiling task ID
taskId: ID!
# process entity
process: Process!
# profiling schedule start timestamp(ms)
startTime: Long!
# profiling schedule finished timestamp(ms)
endTime: Long!
}
input EBPFProfilingAnalyzeTimeRange {
# start timestamp(ms)
start: Long!
# end timestamp(ms)
end: Long!
}
type EBPFProfilingAnalyzation {
# if not empty means backend has information gave to the user
tip: String
# profiling analyzed trees
trees: [EBPFProfilingTree!]!
}
type EBPFProfilingTree {
# profiling stack elements
elements: [EBPFProfilingStackElement!]!
}
type EBPFProfilingStackElement {
# the element ID
id: String!
# the parent element ID
parentId: String!
# stack element symbol name
symbol: String!
# stack element type
stackType: EBPFProfilingStackType!
# current stack element total dump count
dumpCount: Long!
}
# Prepare for creating the eBPF profiling task needs data
type EBPFProfilingTaskPrepare {
# have enough process could profiling
couldProfiling: Boolean!
# all process unique labels for filter
processLabels: [String!]!
}
enum EBPFProfilingStackType {
KERNEL_SPACE,
USER_SPACE
}
# Define when the profiling task would be execute
enum EBPFProfilingTriggerType {
# Appoint the task executing total duration
FIXED_TIME
}
# The way of profiling the process
# relate with Linux function: https://man7.org/linux/man-pages/man2/perf_event_open.2.html
enum EBPFProfilingTargetType {
# Using "PERF_COUNT_SW_CPU_CLOCK" to profiling process with CPU clock
ON_CPU,
# Using "finish_task_switch" of kprobe to profiling process
# relate with blog: https://www.brendangregg.com/offcpuanalysis.html
OFF_CPU
}
enum EBPFProfilingAnalyzeAggregateType {
# Aggregate by the total duration of stack
# For "OFF_CPU" target type of profiling: Statics the total time spent in off cpu.
DURATION,
# Aggregate by the trigger count
# For "ON_CPU" target type of profiling: Statics the number of dump count.
# For "OFF_CPU" target type of profiling: Statics the number of times the process is switched to off cpu by the scheduler.
COUNT
}
extend type Mutation {
# create a new eBPF fixed time profiling task
createEBPFProfilingFixedTimeTask(request: EBPFProfilingTaskFixedTimeCreationRequest!): EBPFProfilingTaskCreationResult!
}
extend type Query {
# query eBPF profiling data for prepare create task
queryPrepareCreateEBPFProfilingTaskData(serviceId: ID!): EBPFProfilingTaskPrepare!
# query eBPF profiling task list
queryEBPFProfilingTasks(serviceId: ID): [EBPFProfilingTask!]!
# query schedules from profiling task
queryEBPFProfilingSchedules(taskId: ID!): [EBPFProfilingSchedule!]!
# analyze the profiling schedule
# aggregateType is "EBPFProfilingAnalyzeAggregateType#COUNT" as default.
analysisEBPFProfilingResult(scheduleIdList: [ID!]!, timeRanges: [EBPFProfilingAnalyzeTimeRange!]!, aggregateType: EBPFProfilingAnalyzeAggregateType): EBPFProfilingAnalyzation!
}