summaryrefslogtreecommitdiffstats
path: root/aai-els-onap-logging/src/main/java
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-06-26 14:12:55 +0200
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-06-28 16:14:12 +0200
commit037c33e49b202218261b474439def75d508717f4 (patch)
treea394dc0d4c8ca7e72a11dbed09441225cc49ddf9 /aai-els-onap-logging/src/main/java
parentbdcbdc723dfb3cd4c29fa3cdbe76ceb0df2a8033 (diff)
Update Janusgraph to 0.5.0 in aai-common
- update tinkerpop to 3.4.13 - update janusgraph to 0.5.0 - restore the total-pages header that was accidentally removed in the last pagination commit - remove stateful pagination logic from HttpEntry Issue-ID: AAI-3900 Change-Id: I5fac397ece75136673b8dc3866e10ff15dfdcee3 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-els-onap-logging/src/main/java')
-rw-r--r--aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MDCSetup.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MDCSetup.java b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MDCSetup.java
index 9b2503b7..1b48eb9b 100644
--- a/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MDCSetup.java
+++ b/aai-els-onap-logging/src/main/java/org/onap/logging/filter/base/MDCSetup.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -168,13 +168,17 @@ public class MDCSetup {
}
public void setElapsedTime() {
- DateTimeFormatter timeFormatter = DateTimeFormatter.ISO_ZONED_DATE_TIME;
- ZonedDateTime entryTimestamp =
- ZonedDateTime.parse(MDC.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP), timeFormatter);
- ZonedDateTime endTimestamp = ZonedDateTime.parse(MDC.get(ONAPLogConstants.MDCs.LOG_TIMESTAMP), timeFormatter);
-
- MDC.put(ONAPLogConstants.MDCs.ELAPSED_TIME,
- Long.toString(ChronoUnit.MILLIS.between(entryTimestamp, endTimestamp)));
+ String entryTimestampString = MDC.get(ONAPLogConstants.MDCs.ENTRY_TIMESTAMP);
+ String elapsedTime = "elapsedTimeIsNotAvailable";
+ if(entryTimestampString != null) {
+ DateTimeFormatter timeFormatter = DateTimeFormatter.ISO_ZONED_DATE_TIME;
+ ZonedDateTime entryTimestamp =
+ ZonedDateTime.parse(entryTimestampString, timeFormatter);
+ String logTimestamp = MDC.get(ONAPLogConstants.MDCs.LOG_TIMESTAMP);
+ ZonedDateTime endTimestamp = ZonedDateTime.parse(logTimestamp, timeFormatter);
+ elapsedTime = Long.toString(ChronoUnit.MILLIS.between(entryTimestamp, endTimestamp));
+ }
+ MDC.put(ONAPLogConstants.MDCs.ELAPSED_TIME, elapsedTime);
}
public void setElapsedTimeInvokeTimestamp() {