@Nullable
    private static ObjectNode maybeCreateConnectionTimings(@Nullable ClientConnectionTimings timings,
                                                           ObjectMapper objectMapper) {
        if (timings == null) {
            return null;
        }

        final ObjectNode objectNode = objectMapper.createObjectNode();
        final ObjectNode connectionObjectNode =
                startTimeAndDuration(objectMapper,
                                     timings.connectionAcquisitionDurationNanos(),
                                     timings.connectionAcquisitionStartTimeMicros());
        objectNode.set("total", connectionObjectNode);

        if (timings.dnsResolutionDurationNanos() >= 0) {
            final ObjectNode dnsObjectNode =
                    startTimeAndDuration(objectMapper,
                                         timings.dnsResolutionDurationNanos(),
                                         timings.dnsResolutionStartTimeMicros());
            objectNode.set("dns", dnsObjectNode);
        }
        if (timings.pendingAcquisitionDurationNanos() >= 0) {
            final ObjectNode pendingObjectNode =
                    startTimeAndDuration(objectMapper,
                                         timings.pendingAcquisitionDurationNanos(),
                                         timings.pendingAcquisitionStartTimeMicros());
            objectNode.set("pending", pendingObjectNode);
        }
        if (timings.socketConnectDurationNanos() >= 0) {
            final ObjectNode socketObjectNode =
                    startTimeAndDuration(objectMapper,
                                         timings.socketConnectDurationNanos(),
                                         timings.socketConnectStartTimeMicros());
            objectNode.set("socket", socketObjectNode);
        }
        if (timings.tlsHandshakeDurationNanos() >= 0) {
            final ObjectNode tlsObjectNode =
                    startTimeAndDuration(objectMapper,
                                         timings.tlsHandshakeDurationNanos(),
                                         timings.tlsHandshakeStartTimeMicros());
            objectNode.set("tls", tlsObjectNode);
        }
        return objectNode;
    }
A formatter that converts a {@link RequestOnlyLog} or {@link RequestLog} into a JSON format message.
core/src/main/java/com/linecorp/armeria/common/logging/JsonLogFormatter.java