|
@@ -80,6 +80,7 @@ func TestParse(t *testing.T) {
|
80
|
80
|
{"tags", "heap"},
|
81
|
81
|
{"tags,unit=bytes", "heap"},
|
82
|
82
|
{"traces", "cpu"},
|
|
83
|
+ {"traces", "heap_tags"},
|
83
|
84
|
{"dot,alloc_space,flat,focus=[234]00", "heap_alloc"},
|
84
|
85
|
{"dot,alloc_space,flat,tagshow=[2]00", "heap_alloc"},
|
85
|
86
|
{"dot,alloc_space,flat,hide=line.*1?23?", "heap_alloc"},
|
|
@@ -398,6 +399,17 @@ func (testFetcher) Fetch(s string, d, t time.Duration) (*profile.Profile, string
|
398
|
399
|
for _, s := range p.Sample {
|
399
|
400
|
s.NumLabel["bytes"] = append(s.NumLabel["bytes"], tags...)
|
400
|
401
|
}
|
|
402
|
+ case "heap_tags":
|
|
403
|
+ p = heapProfile()
|
|
404
|
+
|
|
405
|
+ for i := 0; i < len(p.Sample); i += 2 {
|
|
406
|
+ s := p.Sample[i]
|
|
407
|
+ if s.Label == nil {
|
|
408
|
+ s.Label = make(map[string][]string)
|
|
409
|
+ }
|
|
410
|
+ s.NumLabel["request"] = s.NumLabel["bytes"]
|
|
411
|
+ s.Label["key1"] = []string{"tag"}
|
|
412
|
+ }
|
401
|
413
|
|
402
|
414
|
case "contention":
|
403
|
415
|
p = contentionProfile()
|