From 09e17bb4ebc4d1a418d326ca31bef8ca8a09d671 Mon Sep 17 00:00:00 2001 From: Rebecca Williams Date: Fri, 15 Dec 2023 14:49:31 +0000 Subject: [PATCH] Update readme with new scripts --- performance/README.md | 52 +++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/performance/README.md b/performance/README.md index 38912f3..0ed0cd1 100644 --- a/performance/README.md +++ b/performance/README.md @@ -64,29 +64,39 @@ If running these performance tests against PVWS, some of the default settings of export PV_ARRAY_THROTTLE_MS=10 export EPICS_CA_MAX_ARRAY_BYTES=10000000 +### Python venv +To run the Python scripts, first create a virtual environment and pip install the dependencies: + + python -m venv venv + source venv/bin/activate + + pip install numpy aioca asyncio py-graphql-client websockets + ## Performance tests ### Single screen -Two scripts can be used to create a DB file with _N_ EPICS PVs updating at a given rate and an OPI screen displaying _N_ PVs: +A script can be used to create a DB file with _N_ EPICS PVs updating at a given rate and another can be used to create an OPI or BOB screen displaying _N_ PVs: ./create_db.sh -n -r ./create_opi.sh -n + ./create_bob.sh -n The EPICS db can then be run with: softIoc -d performanceTestDb.db -The generated OPI file and associated JSON file are created under public. These must be moved to the build directory if using the `serve` command above to run the app. E.g. +The generated OPI/BOB file and associated JSON file are created under public. These must be moved to the build directory if using the `serve` command above to run the app. E.g. cp public/performance* build/ ### Multiple screens -The `.create_opi.sh` script can be used to create _M_ screens displaying _N_ PVs using the `-s` option: +The `.create_opi.sh` and `/create_bob.sh` scripts can be used to create _M_ screens displaying _N_ PVs using the `-s` option: ./create_opi.sh -n -s + ./create_bob.sh -n -s -These will be created under public/performanceTestPageXX.opi and public/performancePageXX.json (the first file will have no index). +These will be created under public/performanceTestPageXX.opi or public/performanceTestPageXX.bob and public/performancePageXX.json (the first file will have no index). Remember to adjust the number of PVs in the DB file to match this (i.e. ` x `) @@ -98,12 +108,13 @@ A set of more representative screens with a mixture of update rates and a plotti `./create_example_db.sh -n ` `./create_example_opi.sh -n ` + `./create_example_bob.sh -n ` This will generate a set of screens each with unique PVs. Again, these will be generated in the public/ directory and will need to be copied to the build/ directory to be available at: localhost:3000/performancePage0, localhost:3000/performancePage1, localhost:3000/performancePage2, ... etc. -In order to update the plotting widget with array data, also run the `./caput_to_array.py` script with `-n` for the number of screens: +In order to update the plotting widget with array data, also run the `./update_array_pv.py` script with `-n` for the number of array elements to update (i.e. array size) and `-s` to indicate the number of separate array PVs to update (i.e. number of screens as each screen displays a different array PV): - ./caput_to_array.py -n + ./update_array_pv.py -n -s ### Starting Firefox windows from the terminal @@ -111,9 +122,9 @@ There are two methods of starting up _M_ screens automatically from the terminal 1. Use the `./start_browser.sh` script as: - ./start_browser.sh -s -w + ./start_browser.sh -s -w - These can be opened in separate windows or tabs using the arguments `-w` or `-t` respectively. + These can be opened in separate windows or tabs using the arguments `-w` or `-t` respectively. The number-of-screens specifies how many of the unique OPI screens should be opened (i.e. those generated from [Multiple screens](#multiple-screens) or [Diamond representative screens](#diamond-representative-screens)). In this case the and should match as each unique screen will be opened in a new window, e.g `./start_browser.sh -s 10 -w 10`. This method is slightly less efficient than that described next due to requiring a pause between each window opening. @@ -143,14 +154,7 @@ The Python script will put data to the waveform array at a rate of 10Hz. There are two sets of tests, one against the Coniql back-end server and another against the PVWS back-end server. For each there are two types of test, one in Python and the other in Javascript. -To run the Python scripts, first create a virtual environment and pip install the dependencies: - - python -m venv venv - source venv/bin/activate - - pip install numpy aioca asyncio py-graphql-client websockets - -Run the test with: +After activating the Python venv (details [above](#python-venv)), run the Python test with: python throughput/throughput_XXX.py @@ -161,6 +165,20 @@ To run the Javascript code run: These tests can take up to 30 seconds to run. The rate at which data is received by the client will be printed to the console at the end of the test. The argument `-p` can be appended to both of the above commands to indicate that processing/decoding of the incoming result should be done. This tests the impact of decoding the result on the performance. +### Opening Phoebus standalone windows +There is a script to open multiple Phoebus screens: `./start_phoebus.sh `. Use as: + + ./start_phoebus.sh -n + +By default, the state of Phoebus persists when re-opened. To prevent this, first open Phoebus with the argument: + + phoebus -clear + +After this, run the above script to open _n_ windows. + +Note that an alternative way of doing this would be using Phoebus _layouts_ (see https://control-system-studio.readthedocs.io/en/latest/running.html) + + ### Electron Install dependencies with npm: @@ -183,4 +201,4 @@ Fix with: sudo chown root:root node_modules/electron/dist/chrome-sandbox sudo chmod 4755 node_modules/electron/dist/chrome-sandbox - To open multiple pages with Electron, update the `nPages` value in the `electron/main.js` script. \ No newline at end of file + To open multiple pages with Electron, update the `nPages` value in the `electron/main.js` script.