diff --git a/src/java/com/puppetlabs/puppetserver/MetricsPuppetProfiler.java b/src/java/com/puppetlabs/puppetserver/MetricsPuppetProfiler.java index e02972cd5..34774ce16 100644 --- a/src/java/com/puppetlabs/puppetserver/MetricsPuppetProfiler.java +++ b/src/java/com/puppetlabs/puppetserver/MetricsPuppetProfiler.java @@ -102,15 +102,6 @@ private String safeGet(String[] collection, int i) { } } - private String metricify(String ...ids) { - String base = ids[0]; - List idList = Arrays.asList(ids); - for(String s : idList.subList(1, idList.size())) { - base.concat(".").concat(s); - } - return base; - } - private void updateMetricsTrackers(String[] metricId, Map metricsByID) { String firstElement = safeGet(metricId, 0); String secondElement = safeGet(metricId, 1); @@ -149,7 +140,7 @@ private void updateMetricsTrackers(String[] metricId, Map metrics ("catalog".equals(secondElement) && "munge".equals(thirdElemet)) || ("report".equals(secondElement) && "convert_to_wire_format_hash".equals(thirdElemet)) ) { - String key = metricify(secondElement, thirdElemet); + String key = String.join(".", secondElement, thirdElemet); Timer metric = metricsByID.get(getMetricName(sliceOfArrayToList(metricId, 3))); this.puppetdb_timers.put(key, metric); @@ -161,7 +152,7 @@ private void updateMetricsTrackers(String[] metricId, Map metrics "replace facts".equals(fourthElement) || "replace catalog".equals(fourthElement) ) { - String key = metricify(secondElement, thirdElemet, fourthElement); + String key = String.join(".", secondElement, thirdElemet, fourthElement); Timer metric = metricsByID.get(getMetricName(sliceOfArrayToList(metricId, 4))); this.puppetdb_timers.put(key, metric); }