mirror of
https://github.com/paulscherrerinstitute/sf_daq_broker.git
synced 2026-05-09 05:52:03 +02:00
26 lines
650 B
Python
26 lines
650 B
Python
import json
|
|
|
|
from line_profiler import LineProfiler
|
|
|
|
from sf_databuffer_writer.writer_format import DataBufferH5Writer
|
|
|
|
data_file = "/Users/babic_a/tmp/perf_data.json"
|
|
json_data = json.load(open(data_file))
|
|
|
|
output_file = "ignore_output_new.h5"
|
|
|
|
parameters = {"general/created": "test",
|
|
"general/user": "tester",
|
|
"general/process": "test_process",
|
|
"general/instrument": "mac",
|
|
"output_file": "test.h5"}
|
|
|
|
writer = DataBufferH5Writer(output_file, parameters)
|
|
profiler = LineProfiler()
|
|
profiled_write = profiler(writer.write_data)
|
|
|
|
profiled_write(json_data)
|
|
|
|
writer.close()
|
|
profiler.print_stats()
|