jayshrivastava opened a new issue, #19959:
URL: https://github.com/apache/datafusion/issues/19959
### Is your feature request related to a problem or challenge?
Here's my use case:
```
/// Adds a labels to all metrics in the provided [MetricsSet].
pub fn annotate_metrics_set_with_task_id(metrics_set: MetricsSet, id: u64)
-> MetricsSet {
let mut result = MetricsSet::new();
for metric in metrics_set.iter() {
let mut labels = metric.labels().to_vec();
labels.push(Label::new(
"my_label",
id.to_string(),
));
result.push(Arc::new(Metric::new_with_labels(
metric.value().clone(),
metric.partition(),
labels,
)));
}
result
}
```
I would prefer to not allocate a `Vec` for the new `MetricsSet`
(`MetricsSet::new()` + `push`). I would also prefer not to allocate a whole new
`Vec` of labels: `let mut labels = metric.labels().to_vec();`.
### Describe the solution you'd like
Ideally, there's some sort of interior mutability which lets me modify
labels in place on the original `MetricsSet`.
### Describe alternatives you've considered
_No response_
### Additional context
More context in this
[PR](https://github.com/datafusion-contrib/datafusion-distributed/pull/309)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]