Skip to content

Commit 8d3d0f7

Browse files
committed
Fix formatting of class name in performance summary
Currently the output for an entry that contains a class name looks like this: 2x plugin/latency (Optional[com.google.gerrit.server.events.StreamEventsApiListener]) (total: 63ms, avg: 31ms) Metadata#className returns an Optional<String> and we need to get the value to prevent that " Optional[...]" is included into the output. Release-Notes: skip Change-Id: I4907fe47814e557a3ae86cc05cb032e30dbf4968 Signed-off-by: Edwin Kempin <ekempin@google.com>
1 parent d43e849 commit 8d3d0f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/com/google/gerrit/server/logging/PerformanceLogContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public Optional<String> getPerformanceSummary() {
141141
? performanceLogRecord
142142
.metadata()
143143
.map(Metadata::className)
144-
.map(clazz -> " (" + clazz + ")")
144+
.map(clazz -> clazz.isPresent() ? " (" + clazz.get() + ")" : "")
145145
.orElse("")
146146
: "";
147147
PerformanceInfo info =

0 commit comments

Comments
 (0)