Not thread-safe, exported only for https://pkg.go.dev/flag#Value
(value string)
| 138 | |
| 139 | // Not thread-safe, exported only for https://pkg.go.dev/flag#Value |
| 140 | func (ms *MetricSet) Set(value string) error { |
| 141 | *ms = MetricSet{} |
| 142 | if value == "" { |
| 143 | return nil |
| 144 | } |
| 145 | for _, metric := range strings.Split(value, ",") { |
| 146 | if AllMetrics.Has(MetricKind(metric)) { |
| 147 | (*ms).add(MetricKind(metric)) |
| 148 | } else { |
| 149 | return fmt.Errorf("unsupported metric %q specified", metric) |
| 150 | } |
| 151 | } |
| 152 | return nil |
| 153 | } |
| 154 | |
| 155 | func (ms MetricSet) Difference(ms1 MetricSet) MetricSet { |
| 156 | result := MetricSet{} |