Join joins the metrics passed in with the metrics set, and returns a new copy with the merged metrics.
(metrics *MetricSet)
| 60 | // Join joins the metrics passed in with the metrics set, and returns a new copy |
| 61 | // with the merged metrics. |
| 62 | func (m *MetricSet) Join(metrics *MetricSet) *MetricSet { |
| 63 | newMetrics := make(map[string]bool) |
| 64 | maps.Copy(newMetrics, m.metrics) |
| 65 | maps.Copy(newMetrics, metrics.metrics) |
| 66 | return &MetricSet{metrics: newMetrics} |
| 67 | } |
| 68 | |
| 69 | // Remove removes the metricNames from the metrics set and returns a new copy |
| 70 | // with the metrics removed. |