Skip to content

Commit

Permalink
Merge pull request #6275 from dmitrijus/online_micro_fix_72x
Browse files Browse the repository at this point in the history
Running an online DQM application will no longer require the monitoring ...
  • Loading branch information
cmsbuild committed Nov 11, 2014
2 parents e366b28 + 6950119 commit 8b2e702
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions DQMServices/StreamerIO/scripts/esMonitoring.py
Expand Up @@ -19,6 +19,7 @@ class ElasticReport(object):
def __init__(self, pid, history, json, args):
self.s_history = history
self.s_json = json
self.s_path = "/tmp/dqm_monitoring/"

self.last_make_report = None
self.make_report_timer = 30
Expand Down Expand Up @@ -107,9 +108,13 @@ def update_stderr(self):
def make_report(self):
self.last_make_report = time.time()
self.doc["report_timestamp"] = time.time()

self.update_from_json()
self.make_id()

if not os.path.isdir(self.s_path):
# don't make a report if the directory is not available
return

self.update_ps_status()
self.update_stderr()

Expand All @@ -119,8 +124,8 @@ def make_report(self):
tm = "%.06f+" % time.time()
fn_id = tm + fn_id

fn = os.path.join("/tmp/dqm_monitoring/", fn_id)
fn_tmp = os.path.join("/tmp/dqm_monitoring/", fn_id + ".tmp")
fn = os.path.join(self.s_path, fn_id)
fn_tmp = os.path.join(self.s_path, fn_id + ".tmp")

with open(fn_tmp, "w") as f:
json.dump(self.doc, f, indent=True)
Expand Down

0 comments on commit 8b2e702

Please sign in to comment.