|
@@ -46,9 +46,8 @@ type DotConfig struct {
|
46
|
46
|
LegendURL string // The URL to link to from the legend.
|
47
|
47
|
Labels []string // The labels for the DOT's legend
|
48
|
48
|
|
49
|
|
- FormatValue func(int64) string // A formatting function for values
|
50
|
|
- FormatTag func(int64, string) string // A formatting function for numeric tags
|
51
|
|
- Total int64 // The total weight of the graph, used to compute percentages
|
|
49
|
+ FormatValue func(int64) string // A formatting function for values
|
|
50
|
+ Total int64 // The total weight of the graph, used to compute percentages
|
52
|
51
|
}
|
53
|
52
|
|
54
|
53
|
const maxNodelets = 4 // Number of nodelets for labels (both numeric and non)
|
|
@@ -450,14 +449,9 @@ func tagDistance(t, u *Tag) float64 {
|
450
|
449
|
}
|
451
|
450
|
|
452
|
451
|
func (b *builder) tagGroupLabel(g []*Tag) (label string, flat, cum int64) {
|
453
|
|
- formatTag := b.config.FormatTag
|
454
|
|
- if formatTag == nil {
|
455
|
|
- formatTag = measurement.Label
|
456
|
|
- }
|
457
|
|
-
|
458
|
452
|
if len(g) == 1 {
|
459
|
453
|
t := g[0]
|
460
|
|
- return formatTag(t.Value, t.Unit), t.FlatValue(), t.CumValue()
|
|
454
|
+ return measurement.Label(t.Value, t.Unit), t.FlatValue(), t.CumValue()
|
461
|
455
|
}
|
462
|
456
|
min := g[0]
|
463
|
457
|
max := g[0]
|
|
@@ -481,7 +475,11 @@ func (b *builder) tagGroupLabel(g []*Tag) (label string, flat, cum int64) {
|
481
|
475
|
if dc != 0 {
|
482
|
476
|
c = c / dc
|
483
|
477
|
}
|
484
|
|
- return formatTag(min.Value, min.Unit) + ".." + formatTag(max.Value, max.Unit), f, c
|
|
478
|
+
|
|
479
|
+ // Tags are not scaled with the selected output unit because tags are often
|
|
480
|
+ // much smaller than other values which appear, so the range of tag sizes
|
|
481
|
+ // sometimes would appear to be "0..0" when scaled to the selected output unit.
|
|
482
|
+ return measurement.Label(min.Value, min.Unit) + ".." + measurement.Label(max.Value, max.Unit), f, c
|
485
|
483
|
}
|
486
|
484
|
|
487
|
485
|
func min64(a, b int64) int64 {
|