This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-goapi.git
The following commit(s) were added to refs/heads/main by this push:
new d7cb7be Sync query protocol for eBPF profiling (#27)
d7cb7be is described below
commit d7cb7beadea48ef09e7427126b81df46b3f871c0
Author: mrproliu <[email protected]>
AuthorDate: Sun Mar 20 19:44:16 2022 +0800
Sync query protocol for eBPF profiling (#27)
---
dependencies.sh | 2 +-
query/schema.go | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 230 insertions(+), 1 deletion(-)
diff --git a/dependencies.sh b/dependencies.sh
index 5df68f6..3077a24 100644
--- a/dependencies.sh
+++ b/dependencies.sh
@@ -18,7 +18,7 @@
# under the License.
export COLLECT_PROTOCOL_SHA=b7548df896330bd4cd0ae42d95df9b9cc511f139
-export QUERY_PROTOCOL_SHA=3e31f0ec45d9500daaeda254ed0d8a6fe5cb1570
+export QUERY_PROTOCOL_SHA=7ef57642d94c7a3bcf1c12d78dd32addd524cd33
export ENVOY_SERVICE_PROTOCOL_SHA=533b32f1b390a3a88ec2008d0561e07c926d879a
export XDS_SERVICE_PROTOCOL_SHA=25de7278fc844d392d607214f36dbedf50f167ee
export PROTOC_VALIDATE_SHA=v0.6.1
diff --git a/query/schema.go b/query/schema.go
index 37db3fb..e4c07bc 100644
--- a/query/schema.go
+++ b/query/schema.go
@@ -115,6 +115,77 @@ type Duration struct {
Step Step `json:"step"`
}
+type EBPFProfilingAnalyzation struct {
+ Tip *string `json:"tip"`
+ Trees []*EBPFProfilingTree `json:"trees"`
+}
+
+type EBPFProfilingAnalyzeTimeRange struct {
+ Start int64 `json:"start"`
+ End int64 `json:"end"`
+}
+
+type EBPFProfilingProcessFinder struct {
+ FinderType EBPFProfilingProcessFinderType `json:"finderType"`
+ ProcessID *string `json:"processId"`
+}
+
+type EBPFProfilingSchedule struct {
+ ScheduleID string `json:"scheduleId"`
+ TaskID string `json:"taskId"`
+ ProcessID string `json:"processId"`
+ StartTime int64 `json:"startTime"`
+ EndTime int64 `json:"endTime"`
+}
+
+type EBPFProfilingStackElement struct {
+ ID string `json:"id"`
+ ParentID string `json:"parentId"`
+ Symbol string `json:"symbol"`
+ StackType EBPFProfilingStackType `json:"stackType"`
+ DumpCount int64 `json:"dumpCount"`
+}
+
+type EBPFProfilingTask struct {
+ TaskID string `json:"taskId"`
+ ProcessFinderType EBPFProfilingProcessFinderType
`json:"processFinderType"`
+ ServiceID *string `json:"serviceId"`
+ ServiceName *string `json:"serviceName"`
+ InstanceID *string `json:"instanceId"`
+ InstanceName *string
`json:"instanceName"`
+ ProcessID *string `json:"processId"`
+ ProcessName *string `json:"processName"`
+ TaskStartTime int64
`json:"taskStartTime"`
+ TriggerType EBPFProfilingTriggerType `json:"triggerType"`
+ FixedTriggerDuration *int64
`json:"fixedTriggerDuration"`
+ TargetType EBPFProfilingTargetType `json:"targetType"`
+ CreateTime int64 `json:"createTime"`
+}
+
+type EBPFProfilingTaskCondition struct {
+ FinderType *EBPFProfilingProcessFinderType `json:"finderType"`
+ ServiceID *string `json:"serviceId"`
+ InstanceID *string `json:"instanceId"`
+ ProcessID *string `json:"processId"`
+}
+
+type EBPFProfilingTaskCreationResult struct {
+ Status bool `json:"status"`
+ ErrorReason *string `json:"errorReason"`
+ ID *string `json:"id"`
+}
+
+type EBPFProfilingTaskFixedTimeCreationRequest struct {
+ ProcessFinder *EBPFProfilingProcessFinder `json:"processFinder"`
+ StartTime int64 `json:"startTime"`
+ Duration int `json:"duration"`
+ TargetType EBPFProfilingTargetType `json:"targetType"`
+}
+
+type EBPFProfilingTree struct {
+ Elements []*EBPFProfilingStackElement `json:"elements"`
+}
+
type Endpoint struct {
ID string `json:"id"`
Name string `json:"name"`
@@ -646,6 +717,164 @@ func (e DetectPoint) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
+type EBPFProfilingProcessFinderType string
+
+const (
+ EBPFProfilingProcessFinderTypeProcessID EBPFProfilingProcessFinderType
= "PROCESS_ID"
+)
+
+var AllEBPFProfilingProcessFinderType = []EBPFProfilingProcessFinderType{
+ EBPFProfilingProcessFinderTypeProcessID,
+}
+
+func (e EBPFProfilingProcessFinderType) IsValid() bool {
+ switch e {
+ case EBPFProfilingProcessFinderTypeProcessID:
+ return true
+ }
+ return false
+}
+
+func (e EBPFProfilingProcessFinderType) String() string {
+ return string(e)
+}
+
+func (e *EBPFProfilingProcessFinderType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = EBPFProfilingProcessFinderType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid
EBPFProfilingProcessFinderType", str)
+ }
+ return nil
+}
+
+func (e EBPFProfilingProcessFinderType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type EBPFProfilingStackType string
+
+const (
+ EBPFProfilingStackTypeKernelSpace EBPFProfilingStackType =
"KERNEL_SPACE"
+ EBPFProfilingStackTypeUserSpace EBPFProfilingStackType = "USER_SPACE"
+)
+
+var AllEBPFProfilingStackType = []EBPFProfilingStackType{
+ EBPFProfilingStackTypeKernelSpace,
+ EBPFProfilingStackTypeUserSpace,
+}
+
+func (e EBPFProfilingStackType) IsValid() bool {
+ switch e {
+ case EBPFProfilingStackTypeKernelSpace, EBPFProfilingStackTypeUserSpace:
+ return true
+ }
+ return false
+}
+
+func (e EBPFProfilingStackType) String() string {
+ return string(e)
+}
+
+func (e *EBPFProfilingStackType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = EBPFProfilingStackType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid EBPFProfilingStackType",
str)
+ }
+ return nil
+}
+
+func (e EBPFProfilingStackType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type EBPFProfilingTargetType string
+
+const (
+ EBPFProfilingTargetTypeOnCPU EBPFProfilingTargetType = "ON_CPU"
+)
+
+var AllEBPFProfilingTargetType = []EBPFProfilingTargetType{
+ EBPFProfilingTargetTypeOnCPU,
+}
+
+func (e EBPFProfilingTargetType) IsValid() bool {
+ switch e {
+ case EBPFProfilingTargetTypeOnCPU:
+ return true
+ }
+ return false
+}
+
+func (e EBPFProfilingTargetType) String() string {
+ return string(e)
+}
+
+func (e *EBPFProfilingTargetType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = EBPFProfilingTargetType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid EBPFProfilingTargetType",
str)
+ }
+ return nil
+}
+
+func (e EBPFProfilingTargetType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
+type EBPFProfilingTriggerType string
+
+const (
+ EBPFProfilingTriggerTypeFixedTime EBPFProfilingTriggerType =
"FIXED_TIME"
+)
+
+var AllEBPFProfilingTriggerType = []EBPFProfilingTriggerType{
+ EBPFProfilingTriggerTypeFixedTime,
+}
+
+func (e EBPFProfilingTriggerType) IsValid() bool {
+ switch e {
+ case EBPFProfilingTriggerTypeFixedTime:
+ return true
+ }
+ return false
+}
+
+func (e EBPFProfilingTriggerType) String() string {
+ return string(e)
+}
+
+func (e *EBPFProfilingTriggerType) UnmarshalGQL(v interface{}) error {
+ str, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("enums must be strings")
+ }
+
+ *e = EBPFProfilingTriggerType(str)
+ if !e.IsValid() {
+ return fmt.Errorf("%s is not a valid EBPFProfilingTriggerType",
str)
+ }
+ return nil
+}
+
+func (e EBPFProfilingTriggerType) MarshalGQL(w io.Writer) {
+ fmt.Fprint(w, strconv.Quote(e.String()))
+}
+
type ErrorCategory string
const (