From f0943e59195cbccf9a6f27e73c7e641ea7a1be5f Mon Sep 17 00:00:00 2001 From: Data Backend account Date: Tue, 15 Feb 2022 09:44:01 +0100 Subject: [PATCH 1/3] verbose status check script --- eiger/xbl-daq-24/check_services.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/eiger/xbl-daq-24/check_services.sh b/eiger/xbl-daq-24/check_services.sh index 42cc774..6e3b4c5 100755 --- a/eiger/xbl-daq-24/check_services.sh +++ b/eiger/xbl-daq-24/check_services.sh @@ -1,10 +1,26 @@ #!/bin/bash GREP="std|streamvis" -while getopts g: flag +RESTART="OFF" +STATUS_VERBOSE="OFF" +while getopts g:s: flag do case "${flag}" in g) GREP=${OPTARG};; +# r) RESTART='ON';; + s) STATUS_VERBOSE=${OPTARG};; esac done + +if [ ${STATUS_VERBOSE} = "ON" ]; then + systemctl list-units --type service --all | grep -E ${GREP} | awk '{print $1}' | xargs -I{} systemctl status {} +fi + +#if [ RESTART = "ON" ]; then +# systemctl list-units --type service --all | grep -E ${GREP} | awk '{print $1}' | xargs -I{} systemctl restart {} +#fi + systemctl list-units --type service --all | grep -E ${GREP} | awk 'BEGIN{print "Unit State Status"};$4 ~ /^running$/{print $1,$2,$4}' | column -t + + + From ef8c6cbff92259e1b51d3a365c6bc831eac2893c Mon Sep 17 00:00:00 2001 From: Data Backend account Date: Tue, 15 Feb 2022 10:20:03 +0100 Subject: [PATCH 2/3] rabbitmq service in check script --- eiger/xbl-daq-24/check_services.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eiger/xbl-daq-24/check_services.sh b/eiger/xbl-daq-24/check_services.sh index 6e3b4c5..1aa40b7 100755 --- a/eiger/xbl-daq-24/check_services.sh +++ b/eiger/xbl-daq-24/check_services.sh @@ -1,6 +1,6 @@ #!/bin/bash -GREP="std|streamvis" +GREP="std|streamvis|rabbit" RESTART="OFF" STATUS_VERBOSE="OFF" while getopts g:s: flag From 4bfca9ab55d7d579681cf7110bbaf341d31aebde Mon Sep 17 00:00:00 2001 From: Data Backend account Date: Tue, 15 Feb 2022 17:15:55 +0100 Subject: [PATCH 3/3] eiger set config and start example --- eiger/xbl-daq-24/start_request.py | 34 +++++++++++++------------------ 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/eiger/xbl-daq-24/start_request.py b/eiger/xbl-daq-24/start_request.py index e509377..984eadc 100644 --- a/eiger/xbl-daq-24/start_request.py +++ b/eiger/xbl-daq-24/start_request.py @@ -5,13 +5,22 @@ import json # writer agent endpoint URL = "http://127.0.0.1:5000" -# type of write request -SYNC = "/write_sync" # details of request -n_images = 3 -n_acquisitions = 1000 +n_images = 10 +n_acquisitions = 5 headers = {'Content-type': 'application/json'} +print("Configuring the detector...") +data_config = {"det_name":"eiger","config":{"frames":100,"dr":16, "triggers":1, "exptime":0.000005, "timing":"auto", "tengiga":1}} +r = requests.post(url="http://127.0.0.1:5000/detector", headers=headers, json=data_config) +time.sleep(0.5) + + +print("Starting the detector...") +start_data = {'cmd':"START"} +r = requests.post(url = "http://127.0.0.1:5000/detector/eiger", headers=headers, json=start_data) +time.sleep(0.5) + print("Performing sync aquisitions...") for i in range(0,n_acquisitions): output_file ='/home/dbe/git/sf_daq_buffer/eiger/xbl-daq-24/output_folder/eiger_sync_%s_%s.h5' % (datetime.now().strftime("%H%M%S"), i) @@ -20,22 +29,7 @@ for i in range(0,n_acquisitions): print("REQUEST: ", i) print("DATA: ", data) - r = requests.post(url = "http://127.0.0.1:5000/write_sync", json=data, headers=headers) + r = requests.post(url = "http://127.0.0.1:5000/write_async", json=data, headers=headers) print("RESPONSE FROM REQUEST: ", r.text) - data = None time.sleep(0.2) -# time.sleep(3) -# print("Performing async aquisitions...") -# for i in range(0,n_acquisitions): -# output_file ='/home/hax_l/tests/eiger_async_%s_%s.h5' % (datetime.now().strftime("%H%M%S"), i) -# data = {'sources':'eiger', 'n_images':n_images, 'output_file':output_file} -# print("REQUEST: ", i) -# print("DATA: ", data) - -# r = requests.post(url = "http://127.0.0.1:5000/write_async", json=data, headers=headers) -# data = None -# time.sleep(1) - - -# #//TODO print("Testing kill aquisitions...")