NAME
sdrwatch - SDR non-volatile data store activity monitor
SYNOPSIS
sdrwatch [ sdr_name ] [ -t | -s | -r | -z ] [interval [count [ verbose ]]]
sdrwatch [ sdr_name ] -d [ interval_minutes [ percent_threshold ] ]
DESCRIPTION
For count interations (defaulting to 1), sdrwatch sleeps interval seconds and then performs the SDR operation indicated by the specified mode: 's' to print statistics, 'r' to reset statistics, 'z' to print ZCO space utilization, 't' (the default) to call the sdr_print_trace() function (see sdr(3)) to report on SDR data storage management activity in the SDR data store identified by sdr_name during that interval. If the optional verbose parameter is specified, the printed SDR activity trace will be verbose as described in sdr(3). The 's', 'r' and 'z' modes do not enable tracing.
If sdr_name is omitted, sdrwatch will auto-detect the SDR name from the ION configuration.
If interval is zero, sdrwatch just performs the indicated operation once (for 't', it merely prints a current usage summary for the indicated data store) and terminates.
sdrwatch is helpful for detecting and diagnosing storage space leaks. For debugging the ION protocol stack, sdr_name is normally "ion" but might be overridden by the value of sdrName in the .ionconfig file used to configure the node under study.
Daemon Mode
When invoked with the -d flag, sdrwatch runs as a background daemon that periodically reports SDR heap usage and ZCO inbound/outbound heap occupancy percentages to ion.log. No memory allocation tracing is performed in this mode, minimizing overhead.
The daemon reports three metrics:
- SDR heap usage percentage (total unavailable bytes / heap size)
- ZCO inbound heap occupancy percentage
- ZCO outbound heap occupancy percentage
The daemon reports when either:
- The reporting interval elapses (default: 10 minutes)
- Any of the three metrics crosses a threshold boundary (default: 5%, meaning reports occur when any metric crosses 5%, 10%, 15%, etc.)
If sdr_name is omitted, it is auto-detected from the ION configuration.
-
interval_minutes
Reporting interval in minutes. Default is 10.
-
percent_threshold
Percentage threshold for change reporting. Default is 5, meaning a report is generated whenever any metric crosses any multiple of 5%.
The daemon can be stopped by sending SIGTERM or SIGINT to the process.
EXIT STATUS
-
"0"
sdrwatch has terminated.
FILES
No configuration files are needed.
ENVIRONMENT
No environment variables apply.
DIAGNOSTICS
The following diagnostics may be issued to the ion.log log file:
-
Can't attach to sdr.
ION system error. One possible cause is that ION has not yet been initialized on the local computer; run ionadmin(1) to correct this.
-
Can't start trace.
Insufficient ION working memory to contain trace information. Reinitialize ION with more memory.
BUGS
Report bugs to <https://github.com/nasa-jpl/ION-DTN/issues>
SEE ALSO
psmwatch(1), sdr(3)