Skip to content
Snippets Groups Projects
Commit 0a0dbfcb authored by Johannes Heuel's avatar Johannes Heuel Committed by Rosen Matev
Browse files

Update test for new JSONSink

parent 44df1f1c
No related branches found
Tags v45r4
1 merge request!3700Update test for new JSONSink
......@@ -29,7 +29,12 @@ def config():
},
OutputLevel=1),
]
counterSink = C.Gaudi.Monitoring.JSONSink(FileName=JSON_DUMP_FILENAME)
counterSink = C.Gaudi.Monitoring.JSONSink(
FileName=JSON_DUMP_FILENAME,
TypesToSave=["count.*"],
ComponentsToSave=["DQFilter"],
NamesToSave=["accepted"],
)
app = C.ApplicationMgr(
EvtMax=10, EvtSel="NONE", TopAlg=algs, ExtSvc=[counterSink])
return [app, counterSink] + algs
......@@ -52,5 +57,11 @@ def test():
assert reasons == {"1": "a", "3": "b", "5": "a, b", "6": "b", "7": "b"}
counters = json.load(open(JSON_DUMP_FILENAME))
assert counters["DQFilter"]["accepted"]["nFalseEntries"] == 5
assert counters["DQFilter"]["accepted"]["nTrueEntries"] == 5
counters = [ # filter for counter of interest
c for c in counters
if c["component"] == "DQFilter" and c["name"] == "accepted"
]
assert len(counters) == 1
counter = counters[0]["entity"]
assert counter["nFalseEntries"] == 5
assert counter["nTrueEntries"] == 5
......@@ -804,8 +804,7 @@ def configure(options,
# configure the monitoring sink that writes to a file
if options.monitoring_file:
sink = setup_component(
JSONSink, FileName=options.monitoring_file, DumpFullInfo=True)
sink = setup_component(JSONSink, FileName=options.monitoring_file)
config.add(sink)
appMgr.ExtSvc += [sink]
......
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