diff --git a/CHANGES.md b/CHANGES.md index 267f6ff4..907c61da 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Release Notes. - Add the sub-command `process estimate scale` to estimate the process scale.(#142) - Update the `process list` to must be provided the instance and duration.(#144) - Remove `layer` field in the `instance` and `process` commands for 9.1.0 GraphQL query protocol's breaking changes (#149) +- Remove `duration` flag in `profiling ebpf schedules`.(#150) 0.10.0 ------------------ diff --git a/assets/graphqls/profiling/ebpf/QueryEBPFProfilingScheduleList.graphql b/assets/graphqls/profiling/ebpf/QueryEBPFProfilingScheduleList.graphql index 18c109e1..ec0dd419 100644 --- a/assets/graphqls/profiling/ebpf/QueryEBPFProfilingScheduleList.graphql +++ b/assets/graphqls/profiling/ebpf/QueryEBPFProfilingScheduleList.graphql @@ -15,8 +15,8 @@ # specific language governing permissions and limitations # under the License. -query ($taskID: ID!, $duration: Duration!){ - result: queryEBPFProfilingSchedules(taskId: $taskID, duration: $duration) { +query ($taskID: ID!){ + result: queryEBPFProfilingSchedules(taskId: $taskID) { scheduleId taskId startTime @@ -28,7 +28,6 @@ query ($taskID: ID!, $duration: Duration!){ serviceName instanceId instanceName - layer agentId detectType labels diff --git a/internal/commands/profiling/ebpf/schedules.go b/internal/commands/profiling/ebpf/schedules.go index c3b8caff..976b3bcd 100644 --- a/internal/commands/profiling/ebpf/schedules.go +++ b/internal/commands/profiling/ebpf/schedules.go @@ -18,13 +18,9 @@ package ebpf import ( - api "skywalking.apache.org/repo/goapi/query" - "github.com/urfave/cli/v2" - "github.com/apache/skywalking-cli/internal/commands/interceptor" "github.com/apache/skywalking-cli/internal/flags" - "github.com/apache/skywalking-cli/internal/model" "github.com/apache/skywalking-cli/pkg/display" "github.com/apache/skywalking-cli/pkg/display/displayable" "github.com/apache/skywalking-cli/pkg/graphql/profiling" @@ -41,7 +37,6 @@ Example: $ swctl profiling ebpf schedules --task-id=abc `, Flags: flags.Flags( - flags.DurationFlags, []cli.Flag{ &cli.StringFlag{ Name: "task-id", @@ -50,20 +45,10 @@ $ swctl profiling ebpf schedules --task-id=abc }, }, ), - Before: interceptor.BeforeChain( - interceptor.DurationInterceptor, - ), Action: func(ctx *cli.Context) error { taskID := ctx.String("task-id") - start := ctx.String("start") - end := ctx.String("end") - step := ctx.Generic("step") - schedules, err := profiling.QueryEBPFProfilingScheduleList(ctx, taskID, &api.Duration{ - Start: start, - End: end, - Step: step.(*model.StepEnumValue).Selected, - }) + schedules, err := profiling.QueryEBPFProfilingScheduleList(ctx, taskID) if err != nil { return err } diff --git a/pkg/graphql/profiling/ebpf.go b/pkg/graphql/profiling/ebpf.go index b9c21f1f..16408e50 100644 --- a/pkg/graphql/profiling/ebpf.go +++ b/pkg/graphql/profiling/ebpf.go @@ -62,13 +62,11 @@ func QueryEBPFProfilingTaskList(ctx *cli.Context, serviceID string) ([]*api.EBPF return response["result"], err } -func QueryEBPFProfilingScheduleList(ctx *cli.Context, taskID string, - duration *api.Duration) ([]*api.EBPFProfilingSchedule, error) { +func QueryEBPFProfilingScheduleList(ctx *cli.Context, taskID string) ([]*api.EBPFProfilingSchedule, error) { var response map[string][]*api.EBPFProfilingSchedule request := graphql.NewRequest(assets.Read("graphqls/profiling/ebpf/QueryEBPFProfilingScheduleList.graphql")) request.Var("taskID", taskID) - request.Var("duration", duration) err := client.ExecuteQuery(ctx, request, &response)