Skip to content

Commit b995e12

Browse files
committed
(PE-38408) Add additional PuppetDB metrics
Based on discussion with Austin Blatt these additional metrics could be helpful in diagnosing issues with PuppetDB. > The reports.process, catalog.save and facts.save metrics would likely be > useful as they are the highest level metrics closest to "how long did the > puppetdb terminus take?". > > puppetdb.payload.format would be good to include as well in case our json > conversion is slow. We do have to do some string manipulation there, so it > isn't just Ruby's to_json function. > > I'm less familiar with the terminus's use for querying, but I imagine > puppetdb.query, puppetdb.facts.find, and puppetdb.facts.search would be > good to include assuming those terminus functions are used somewhere.
1 parent 9ee8a44 commit b995e12

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/java/com/puppetlabs/puppetserver/MetricsPuppetProfiler.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ private void updateMetricsTrackers(String[] metricId, Map<String, Timer> metrics
136136

137137
if (
138138
("resource".equals(secondElement) && "search".equals(thirdElemet)) ||
139-
("facts".equals(secondElement) && "encode".equals(thirdElemet)) ||
140-
("catalog".equals(secondElement) && "munge".equals(thirdElemet)) ||
141-
("report".equals(secondElement) && "convert_to_wire_format_hash".equals(thirdElemet))
139+
("payload".equals(secondElement) && "format".equals(thirdElemet)) ||
140+
// Set.of would be preferrable but 7.x still support Java 8, which does not have Set.of
141+
("facts".equals(secondElement) && Arrays.asList("save", "find", "search", "encode").contains(thirdElemet)) ||
142+
("catalog".equals(secondElement) && Arrays.asList("save", "munge").contains(thirdElemet)) ||
143+
("report".equals(secondElement) && Arrays.asList("convert_to_wire_format_hash", "process").contains(thirdElemet))
142144
) {
143145
String key = String.join(".", secondElement, thirdElemet);
144146
Timer metric = metricsByID.get(getMetricName(sliceOfArrayToList(metricId, 3)));

0 commit comments

Comments
 (0)