Commit af5143e3 authored by Hana Kim's avatar Hana Kim Committed by Hyang-Ah Hana Kim

cmd/trace: use different colors for tasks

and assign the same colors for spans belong to the tasks
(sadly, the trace viewer will change the saturation/ligthness
for asynchronous slices so exact color mapping is impossible.
But I hope they are not too far from each other)

Change-Id: Idaaf0828a1e0dac8012d336dcefa1c6572ddca2e
Reviewed-on: https://go-review.googlesource.com/109338
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarHeschi Kreinick <heschi@google.com>
parent 8a958bb8
......@@ -900,7 +900,7 @@ func (ctx *traceContext) emitTask(task *taskDesc, sortIndex int) {
Dur: durationUsec,
Pid: tasksSection,
Tid: taskRow,
Cname: colorSeafoamGreen,
Cname: pickTaskColor(task.id),
}
targ := TaskArg{ID: task.id}
if task.create != nil {
......@@ -946,7 +946,7 @@ func (ctx *traceContext) emitRegion(s regionDesc) {
Tid: s.G, // only in goroutine-oriented view
ID: uint64(regionID),
Scope: scopeID,
Cname: colorDeepMagenta,
Cname: pickTaskColor(s.TaskID),
}
if s.Start != nil {
sl0.Stack = ctx.stack(s.Start.Stk)
......@@ -961,7 +961,7 @@ func (ctx *traceContext) emitRegion(s regionDesc) {
Tid: s.G,
ID: uint64(regionID),
Scope: scopeID,
Cname: colorDeepMagenta,
Cname: pickTaskColor(s.TaskID),
Arg: RegionArg{TaskID: s.TaskID},
}
if s.End != nil {
......@@ -1222,7 +1222,38 @@ const (
colorLime = "cq_build_passed" // 153, 238, 102
colorPink = "cq_build_failed" // 238, 136, 136
colorSilver = "cq_build_abandoned" // 187, 187, 187
colorManzGreen = "cq_build_attempt_running" // 222, 222, 75
colorManzGreen = "cq_build_attempt_runnig" // 222, 222, 75
colorKellyGreen = "cq_build_attempt_passed" // 108, 218, 35
colorFuzzyWuzzyBrown = "cq_build_attempt_failed" // 187, 187, 187
colorAnotherGrey = "cq_build_attempt_failed" // 187, 187, 187
)
var colorForTask = []string{
colorLightMauve,
colorOrange,
colorSeafoamGreen,
colorVistaBlue,
colorTan,
colorMidnightBlue,
colorIrisBlue,
colorDeepMagenta,
colorGreen,
colorDarkGoldenrod,
colorPeach,
colorOlive,
colorCornflowerBlue,
colorSunsetOrange,
colorTangerine,
colorShamrockGreen,
colorTawny,
colorLemon,
colorLime,
colorPink,
colorSilver,
colorManzGreen,
colorKellyGreen,
}
func pickTaskColor(id uint64) string {
idx := id % uint64(len(colorForTask))
return colorForTask[idx]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment