Skip to content

Commit

Permalink
Merge pull request #641 from Channyboy/micrometer-mpm51-fixes
Browse files Browse the repository at this point in the history
Additional fixes for 5.1.0
  • Loading branch information
Channyboy authored Sep 21, 2023
2 parents 5dedbc2 + 0c3e73c commit 68dc254
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ private void resolveMeterSuffixes(Set<String> set, Type inputType) {
set.add("_count");
set.add("_sum");
set.add("_max");
set.add("_bucket");
break;
default:
if (LOGGER.isLoggable(Level.FINEST)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public static Collection<HistogramBucketMaxConfiguration> parse(String input) {
}

// LIFO - right most configuration takes precedence
metricBucketMinMax.addFirst(metricBucketConfiguration);
if (metricBucketConfiguration != null) {
metricBucketMinMax.addFirst(metricBucketConfiguration);
}

}
return metricBucketMinMax;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public static Collection<HistogramBucketMinConfiguration> parse(String input) {
}

// LIFO - right most configuration takes precedence
metricBucketMinMax.addFirst(metricBucketConfiguration);
if (metricBucketConfiguration != null) {
metricBucketMinMax.addFirst(metricBucketConfiguration);
}

}
return metricBucketMinMax;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static Collection<TimerBucketMaxConfiguration> parse(String input) {
String metricName = keyValueSplit[0];

TimerBucketMaxConfiguration sloMinConfiguration = null;
Duration dur;
Duration dur = null;
// metricGroup=<blank> == invalid
if (keyValueSplit.length == 2) {

Expand Down Expand Up @@ -69,10 +69,13 @@ public static Collection<TimerBucketMaxConfiguration> parse(String input) {
continue;
}

sloMinConfiguration = new TimerBucketMaxConfiguration(metricName, dur);
if (dur != null) {
sloMinConfiguration = new TimerBucketMaxConfiguration(metricName, dur);

// LIFO - right most configuration takes precedence
sloMinConfigCollection.addFirst(sloMinConfiguration);
}

// LIFO - right most configuration takes precedence
sloMinConfigCollection.addFirst(sloMinConfiguration);
}
return sloMinConfigCollection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static Collection<TimerBucketMinConfiguration> parse(String input) {
String metricName = keyValueSplit[0];

TimerBucketMinConfiguration sloMinConfiguration = null;
Duration dur;
Duration dur = null;
// metricGroup=<blank> == invalid
if (keyValueSplit.length == 2) {

Expand Down Expand Up @@ -69,10 +69,13 @@ public static Collection<TimerBucketMinConfiguration> parse(String input) {
continue;
}

sloMinConfiguration = new TimerBucketMinConfiguration(metricName, dur);
if (dur != null) {
sloMinConfiguration = new TimerBucketMinConfiguration(metricName, dur);

// LIFO - right most configuration takes precedence
sloMinConfigCollection.addFirst(sloMinConfiguration);
}

// LIFO - right most configuration takes precedence
sloMinConfigCollection.addFirst(sloMinConfiguration);
}
return sloMinConfigCollection;

Expand Down

0 comments on commit 68dc254

Please sign in to comment.