From d6f679173f52b695cec6a0f5868c648a1b4bf25a Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Thu, 11 Jan 2024 00:40:11 -0600 Subject: [PATCH] auto symlink heartbeat file --- .../nosqlbench/nb/api/components/status/ComponentPulse.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/components/status/ComponentPulse.java b/nb-api/src/main/java/io/nosqlbench/nb/api/components/status/ComponentPulse.java index 32d0e6403..c61c4dec1 100644 --- a/nb-api/src/main/java/io/nosqlbench/nb/api/components/status/ComponentPulse.java +++ b/nb-api/src/main/java/io/nosqlbench/nb/api/components/status/ComponentPulse.java @@ -52,6 +52,11 @@ public class ComponentPulse extends UnstartedPeriodicTaskComponent { Heartbeat heartbeat = pulseOf.heartbeat().withHeartbeatDetails(intervalmillis,System.currentTimeMillis()); try { Files.writeString(hbpath, heartbeat.toYaml(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); + Files.deleteIfExists(linkpath); + Files.createSymbolicLink( + linkpath, + hbpath.getFileName() + ); } catch (IOException e) { logger.error("Unable to write heartbeat data to " + hbpath.toString() + ": " + e); }