| 128 | } |
| 129 | |
| 130 | func poolStatsAttrs(conf *config) (poolAttrs, idleAttrs, usedAttrs attribute.Set) { |
| 131 | poolAttrs = attribute.NewSet(conf.attrs...) |
| 132 | idleAttrs = attribute.NewSet(append(poolAttrs.ToSlice(), attribute.String("state", "idle"))...) |
| 133 | usedAttrs = attribute.NewSet(append(poolAttrs.ToSlice(), attribute.String("state", "used"))...) |
| 134 | return |
| 135 | } |
| 136 | |
| 137 | func reportPoolStats(rdb *redis.Client, conf *config) (metric.Registration, error) { |
| 138 | poolAttrs, idleAttrs, usedAttrs := poolStatsAttrs(conf) |