()
| 33 | } |
| 34 | |
| 35 | func (this *Manager) Labels() map[string]float64 { |
| 36 | var result = map[string]float64{} |
| 37 | this.locker.Lock() |
| 38 | for label, costs := range this.m { |
| 39 | var sum float64 |
| 40 | for _, cost := range costs { |
| 41 | sum += cost |
| 42 | } |
| 43 | result[label] = sum / float64(len(costs)) |
| 44 | } |
| 45 | this.locker.Unlock() |
| 46 | return result |
| 47 | } |