Skip to content

Commit

Permalink
pool: improve flush information
Browse files Browse the repository at this point in the history
Motivation:

The `info` admin command shows lots of information, include things to do
with flushing files to tape.  Once such piece of information is when the
next flush will take place.

Currently this shows the time as an absolute reference; however, at
least some of the time, an admin wishes to know when the next flush will
take place relative to the current time.

Modification:

Update output so it shows both the absolute time and a relative
clause; e.g., "(5 min in the future)".

Result:

The pool's `info` admin command now shows when the next flush will take
place using both the timestamp and the relative time (e.g., number of
seconds in the future).

Target: master
Requires-notes: yes
Requires-book: no
Patch: https://rb.dcache.org/r/13131/
Acked-by: Lea Morschel
Acked-by: Svenja Meyer
  • Loading branch information
paulmillar committed Aug 14, 2021
1 parent bacafac commit a1f1aff
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING

import java.io.PrintWriter;
import java.io.Serializable;
import java.util.Date;
import java.time.Instant;

import org.dcache.util.TimeUtils;

/**
* <p>Corresponds to the information delivered
Expand Down Expand Up @@ -103,8 +105,8 @@ public void print(PrintWriter pw) {
pw.println(" Minimum flush delay on error : " + flushDelayOnError
+ " ms");
if (nextFlush != null) {
pw.println(" Next flush : " + new Date(
nextFlush));
pw.println(" Next flush : "
+ TimeUtils.relativeTimestamp(Instant.ofEpochMilli(nextFlush)));
}
}

Expand Down

0 comments on commit a1f1aff

Please sign in to comment.