From abc542851b2c54b2ecea1794b5013e65686a2ac3 Mon Sep 17 00:00:00 2001 From: steden <1470804@qq.com> Date: Tue, 9 Jan 2024 01:20:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E4=B8=AD=E5=BF=83TaskGroupId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- traceManager.go | 10 +++++----- trackContext.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/traceManager.go b/traceManager.go index da91f57..6104198 100644 --- a/traceManager.go +++ b/traceManager.go @@ -177,7 +177,7 @@ func (*traceManager) EntryTask(taskName string) trace.ITraceContext { } // EntryTaskGroup 创建本地任务入口(调度中心专用) -func (*traceManager) EntryTaskGroup(taskName string, taskGroupName string, taskGroupId int64, taskId int64) trace.ITraceContext { +func (*traceManager) EntryTaskGroup(taskName string, taskGroupName string, taskId int64) trace.ITraceContext { traceId := parse.ToString(snowflake.GenerateId()) context := &TraceContext{ AppId: parse.ToString(core.AppId), @@ -188,8 +188,8 @@ func (*traceManager) EntryTaskGroup(taskName string, taskGroupName string, taskG StartTs: time.Now().UnixMicro(), TraceType: eumTraceType.Task, TaskContext: TaskContext{ - TaskName: fmt.Sprintf("%s,任务组=(%v)%s,任务ID=%v", taskName, taskGroupId, taskGroupName, taskId), - TaskGroupId: taskGroupId, + TaskName: fmt.Sprintf("%s,任务组=%s,任务ID=%v", taskName, taskGroupName, taskId), + TaskGroupName: taskGroupName, TaskId: taskId, }, } @@ -199,7 +199,7 @@ func (*traceManager) EntryTaskGroup(taskName string, taskGroupName string, taskG } // EntryFSchedule 创建调度中心入口 -func (*traceManager) EntryFSchedule(taskGroupName string, taskGroupId int64, taskId int64) trace.ITraceContext { +func (*traceManager) EntryFSchedule(taskGroupName string, taskId int64) trace.ITraceContext { traceId := parse.ToString(snowflake.GenerateId()) context := &TraceContext{ AppId: parse.ToString(core.AppId), @@ -211,7 +211,7 @@ func (*traceManager) EntryFSchedule(taskGroupName string, taskGroupId int64, tas TraceType: eumTraceType.FSchedule, TaskContext: TaskContext{ TaskName: taskGroupName, - TaskGroupId: taskGroupId, + TaskGroupName: taskGroupName, TaskId: taskId, }, } diff --git a/trackContext.go b/trackContext.go index efe5d2c..42b4053 100644 --- a/trackContext.go +++ b/trackContext.go @@ -62,12 +62,12 @@ func (receiver ConsumerContext) IsNil() bool { type TaskContext struct { TaskName string // 任务名称 - TaskGroupId int64 // 任务组ID + TaskGroupName string // 任务组ID TaskId int64 // 任务ID } func (receiver TaskContext) IsNil() bool { - return receiver.TaskName == "" && receiver.TaskGroupId == 0 && receiver.TaskId == 0 + return receiver.TaskName == "" && receiver.TaskGroupName == "" && receiver.TaskId == 0 } type WatchKeyContext struct {