FS = msg_fs ? msg_fs : "|"
OFS = msg_fs ? msg_fs : "|"
Kfs = key_fs ? key_fs : ":"
+ GC_Interval = GC_Interval ? GC_Interval : 3600 # seconds
_total_to_diff["khatus_sensor_net_addr_io", "bytes_read" ] = 1
_total_to_diff["khatus_sensor_net_addr_io", "bytes_written" ] = 1
_cache[src, key] = val
time = cache_get_time()
_cache_mtime[src, key] = time
- if (time % 3600 == 0) {
+ if (time % GC_Interval == 0) {
cache_gc()
}
}
src = parts[1]
key = parts[2]
unused_for = cache_get_time() - _cache_atime[src, key]
- if (unused_for > 3600) {
+ if (unused_for > GC_Interval) {
print_msg_info(\
"cache_gc",
- sprintf("Deleting unused SRC=%s KEY=%s", src, key) \
+ sprintf("Deleting unused data SRC=%s KEY=%s", src, key) \
)
delete _cache[src, key]
}
-v Opt_Mpd_Song_Max_Chars=10 \
-v Opt_Net_Interfaces_To_Show=wlp3s0 \
-v Opt_Pulseaudio_Sink=0 \
+ -v GC_Interval=5 \
) \
>(stdbuf -o L ./bin/khatus_monitor_energy) \
>(stdbuf -o L ./bin/khatus_monitor_errors) \