flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Mushin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-4563) [metrics] scope caching not adjusted for multiple reporters
Date Thu, 29 Sep 2016 09:38:20 GMT

    [ https://issues.apache.org/jira/browse/FLINK-4563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15532305#comment-15532305

Anton Mushin commented on FLINK-4563:

Ok this case if we get f1 in method we must return cached scopeString else for other filters
we are create and return new scopeString.
code is for example, is it correct code?
private String scopeString;
private CharacterFilter firstFilter;
public String getMetricIdentifier(String metricName, CharacterFilter filter) {
		if (firstFilter == null && filter != null) {
			firstFilter = filter;
			scopeString = ScopeFormat.concat(firstFilter, registry.getDelimiter(), scopeComponents);
			return scopeString + registry.getDelimiter() + filter.filterCharacters(metricName);
		if (filter != null) {
			if (firstFilter.equals(filter)) {
				 return scopeString + registry.getDelimiter() + filter.filterCharacters(metricName);
			} else {
				String newScopeString = ScopeFormat.concat(filter, registry.getDelimiter(), scopeComponents);
				return newScopeString + registry.getDelimiter() + filter.filterCharacters(metricName);
		} else {
			String newScopeString = ScopeFormat.concat(registry.getDelimiter(), scopeComponents);
			return newScopeString + registry.getDelimiter() + metricName;

> [metrics] scope caching not adjusted for multiple reporters
> -----------------------------------------------------------
>                 Key: FLINK-4563
>                 URL: https://issues.apache.org/jira/browse/FLINK-4563
>             Project: Flink
>          Issue Type: Bug
>          Components: Metrics
>    Affects Versions: 1.1.0
>            Reporter: Chesnay Schepler
>            Assignee: Anton Mushin
> Every metric group contains a scope string, representing what entities (job/task/etc.)
a given metric belongs to, which is calculated on demand. 
> Before this string is cached a CharacterFilter is applied to it, which is provided by
the callee, usually a reporter. This was done since different reporters have different requirements
in regards to valid characters. The filtered string is cached so that we don't have to refilter
the string every time.
> This all works fine with a single reporter; with multiple however it is completely broken
as only the first filter is ever applied.

This message was sent by Atlassian JIRA

View raw message