/// <summary> /// Returns the logical scope of this group, for example "taskmanager.job.task" /// </summary> /// <param name="filter">character filter which is applied to the scope components</param> /// <param name="delimiter"></param> /// <returns>logical scope</returns> public string GetLogicalScope(ICharacterFilter filter, char delimiter) { if (_logicalScopeString == null) { if (Parent == null) { _logicalScopeString = GetGroupName(filter); } else { _logicalScopeString = Parent.GetLogicalScope(filter, delimiter) + delimiter + GetGroupName(filter); } } return(_logicalScopeString); }
/// <summary> /// Returns the fully qualified metric name using the configured delimiter for the reporter with the given index, for example "host-7.taskmanager-2.window_word_count.my-mapper.metricName". /// </summary> /// <param name="metricName">metric name</param> /// <param name="filter">character filter which is applied to the scope components if not null.</param> /// <param name="reporterIndex">index of the reporter whose delimiter should be used</param> /// <returns>fully qualified metric name</returns> public string GetMetricIdentifier(string metricName, ICharacterFilter filter, int reporterIndex) { var delimiter = Registry.Delimiter; if (_scopeStrings.Length == 0 || (reporterIndex < 0 || reporterIndex >= _scopeStrings.Length)) { string newScopeString; if (filter != null) { newScopeString = ScopeFormat.Concat(filter, delimiter, ScopeComponents); metricName = filter.FilterCharacters(metricName); } else { newScopeString = ScopeFormat.Concat(delimiter, ScopeComponents); } return(newScopeString + delimiter + metricName); } else { if (_scopeStrings[reporterIndex] == null) { if (filter != null) { _scopeStrings[reporterIndex] = ScopeFormat.Concat(filter, delimiter, ScopeComponents); } else { _scopeStrings[reporterIndex] = ScopeFormat.Concat(delimiter, ScopeComponents); } } if (filter != null) { metricName = filter.FilterCharacters(metricName); } return(_scopeStrings[reporterIndex] + delimiter + metricName); } }
protected override string GetGroupName(ICharacterFilter filter) { throw new NotImplementedException(); }
public string GetMetricIdentifier(string metricName, ICharacterFilter filter) => metricName;
protected abstract string GetGroupName(ICharacterFilter filter);
/// <summary> /// Returns the logical scope of this group, for example "taskmanager.job.task" /// </summary> /// <param name="filter">character filter which is applied to the scope components</param> /// <returns>logical scope</returns> public string GetLogicalScope(ICharacterFilter filter) => GetLogicalScope(filter, Registry.Delimiter);
internal static string Concat(ICharacterFilter filter, char delimiter, string[] scopeComponents) { throw new NotImplementedException(); }
protected override string GetGroupName(ICharacterFilter filter) => "taskmanager";