Skip to content
Snippets Groups Projects
Commit 2c717d88 authored by Nikolai.Hartmann's avatar Nikolai.Hartmann
Browse files

add more debugging info in reporter cron job

parent caa94a47
No related branches found
No related tags found
No related merge requests found
# Report xcache file access statistics to ES in Chicago every 30 minutes
0,30 * * * * xcache systemctl is-active --quiet xcache.service && timeout 900 singularity exec -B /etc/xrootd:/etc/xrootd:ro -B /etc/grid-security:/etc/grid-security:ro -B /srv/xcache:/data:rw /var/local/xcache/xcache.img /var/local/xcache/run_reporter.sh
0,30 * * * * xcache systemctl is-active --quiet xcache.service && timeout 900 singularity exec -B /etc/xrootd:/etc/xrootd:ro -B /etc/grid-security:/etc/grid-security:ro -B /srv/xcache:/data:rw /var/local/xcache/xcache.img /var/local/xcache/run_reporter.sh || echo "Exited with $?"
......@@ -103,13 +103,16 @@ def get_info(filename):
files = [y for x in os.walk(BASE_DIR) for y in glob(os.path.join(x[0], '*.cinfo'))]
# files += [y for x in os.walk(BASE_DIR) for y in glob(os.path.join(x[0], '*%'))]
n_touched_files = 0
for filename in files:
last_modification_time = os.stat(filename).st_mtime
# print(filename, last_modification_time)
if last_modification_time > start_time and last_modification_time < end_time:
get_info(filename)
n_touched_files += 1
print("xcache reporter - files touched:", len(reports))
print("xcache reporter - files touched:", n_touched_files)
print("xcache reporter - got {} reports:".format(len(reports))
if len(reports) > 0:
r = requests.post(collector, json=reports)
print('xcache reporter - indexing response:', r.status_code)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment