From c72486c88a32a07ff495d5db7d97ba47525a42db Mon Sep 17 00:00:00 2001 From: Cassandra Tait Date: Wed, 8 Sep 2021 16:31:51 +1000 Subject: [PATCH] reduce method parameters --- .../opentelemetry/server/TeamCityBuildListener.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/com/octopus/teamcity/opentelemetry/server/TeamCityBuildListener.java b/server/src/main/java/com/octopus/teamcity/opentelemetry/server/TeamCityBuildListener.java index 7cf6279..b0f337c 100644 --- a/server/src/main/java/com/octopus/teamcity/opentelemetry/server/TeamCityBuildListener.java +++ b/server/src/main/java/com/octopus/teamcity/opentelemetry/server/TeamCityBuildListener.java @@ -161,8 +161,8 @@ private void buildFinishedOrInterrupted (SRunningBuild build) { Span span = this.otelHelper.getSpan(buildId); Loggers.SERVER.debug("OTEL_PLUGIN: Build finished and span found for " + buildName); try (Scope ignored = span.makeCurrent()){ - createQueuedEventsSpans(build, buildName, span); - createBuildStepSpans(build, buildName, span); + createQueuedEventsSpans(build, span); + createBuildStepSpans(build, span); setArtifactAttributes(build, span); this.otelHelper.addAttributeToSpan(span, PluginConstants.ATTRIBUTE_SUCCESS_STATUS, build.getBuildStatus().isSuccessful()); @@ -185,10 +185,10 @@ private void buildFinishedOrInterrupted (SRunningBuild build) { } } - private void createQueuedEventsSpans(SRunningBuild build, String buildName, Span buildSpan) { + private void createQueuedEventsSpans(SRunningBuild build, Span buildSpan) { long startDateTime = build.getQueuedDate().getTime(); Map reportedStatics = build.getStatisticValues(); - Loggers.SERVER.info("OTEL_PLUGIN: Retrieving queued event spans for build " + buildName); + Loggers.SERVER.info("OTEL_PLUGIN: Retrieving queued event spans for build " + getBuildName(build)); for (Map.Entry entry : reportedStatics.entrySet()) { String key = entry.getKey(); @@ -209,9 +209,9 @@ private void createQueuedEventsSpans(SRunningBuild build, String buildName, Span } } - private void createBuildStepSpans(SRunningBuild build, String buildName, Span buildSpan) { + private void createBuildStepSpans(SRunningBuild build, Span buildSpan) { Map blockMessageSpanMap = new HashMap<>(); - Loggers.SERVER.info("OTEL_PLUGIN: Retrieving build step event spans for build " + buildName); + Loggers.SERVER.info("OTEL_PLUGIN: Retrieving build step event spans for build " + getBuildName(build)); List buildBlockLogs = getBuildBlockLogs(build); for (LogMessage logMessage: buildBlockLogs) { BlockLogMessage blockLogMessage = (BlockLogMessage) logMessage;