Skip to content
Snippets Groups Projects
Commit 86dcf4a1 authored by Rosen Matev's avatar Rosen Matev :sunny:
Browse files

Merge branch 'jheuel_JSONSink' into 'master'

Update test for new JSONSink

See merge request !3700
parents 294712a2 0a0dbfcb
No related branches found
No related tags found
1 merge request!3700Update test for new JSONSink
Pipeline #4302024 passed
......@@ -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