[
https://issues.apache.org/jira/browse/FLINK-4564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15516075#comment-15516075
]
ASF GitHub Bot commented on FLINK-4564:
---------------------------------------
Github user zentol commented on the issue:
https://github.com/apache/flink/pull/2517
alright, I'll sketch some code:
MetricRegistry:
```
List<MetricReporter> reporters = ...
List<FrontMetricGroup> groups = ...
List<Character> delimiter = ...
char getDelimiter(int reporterIndex) {
return delimiter.get(reporterIndex);
void register(Metric metric, String metricName, MetricGroup group) {
...
for (int x= 0; x<reporters.size();x++) {
FrontMetricGroup front = groups.get(x);
front.setReference(group);
reporter.notifyOfAddedMetric(metric, metricName, front);
}
...
}
```
AbstractMetricGroup:
```
String getMetricIdentifier(String name, CharacterFilter filter, int
reporterIndex) {
<copy&paste gMI(name, filter), replace registry.getDelimiter() with
registry.getDelimiter(reporterIndex)>
}
```
FrontMetricGroup:
```
AbstractMetricGroup reference;
int index;
FrontMetricGroup(int index) {
this.index = index;
}
setReference(AbstractMetricGroup reference) {
this.reference = reference;
}
@Override
String getMetricIndentifier(String name, CharacterFilter filter) {
return reference.getMetricIdentifier(name, filter, this.index);
}
<all other MetricGroup methods, forwarding the call to reference>
```
Does this answer your question?
> [metrics] Delimiter should be configured per reporter
> -----------------------------------------------------
>
> Key: FLINK-4564
> URL: https://issues.apache.org/jira/browse/FLINK-4564
> Project: Flink
> Issue Type: Bug
> Components: Metrics
> Affects Versions: 1.1.0
> Reporter: Chesnay Schepler
> Assignee: Anton Mushin
>
> Currently, the delimiter used or the scope string is based on a configuration
> setting shared by all reporters. However, different reporters may have
> different requirements in regards to the delimiter, as such we should allow
> reporters to use a different delimiter.
> We can keep the current setting as a global setting that is used if no
> specific setting was set.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)