From fcf4c833b21e5373b6792b03ffb7b23697fd2a67 Mon Sep 17 00:00:00 2001 From: Cheng-Chin Chiang Date: Mon, 19 Jan 2026 10:23:16 +0800 Subject: [PATCH 1/6] Update the protobuf submodule --- protobuf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobuf b/protobuf index ce92e88..9b181d2 160000 --- a/protobuf +++ b/protobuf @@ -1 +1 @@ -Subproject commit ce92e886d2a7e89ea264b2a4295f94ea729280ba +Subproject commit 9b181d2811807bec2af667eb5330aa6567bbf428 From b58cbd17dbd69435529438afe6cdd5cbbb39a7bf Mon Sep 17 00:00:00 2001 From: Cheng-Chin Chiang Date: Mon, 19 Jan 2026 11:08:48 +0800 Subject: [PATCH 2/6] Update the timeout settings for performance tests --- src/performance/PERF_ANIMATOR_CONTOUR_CASA.test.ts | 4 ++-- src/performance/PERF_ANIMATOR_CONTOUR_FITS.test.ts | 4 ++-- src/performance/PERF_ANIMATOR_CONTOUR_HDF5.test.ts | 4 ++-- src/performance/PERF_CONTOUR_DATA_Mode0.test.ts | 2 +- src/performance/PERF_CONTOUR_DATA_Mode1.test.ts | 2 +- src/performance/PERF_CONTOUR_DATA_Mode2.test.ts | 2 +- src/performance/PERF_LOAD_IMAGE_CASA.test.ts | 2 +- src/performance/PERF_LOAD_IMAGE_FITS.test.ts | 2 +- src/performance/PERF_LOAD_IMAGE_HDF5.test.ts | 2 +- src/performance/PERF_PV_CASA.test.ts | 2 +- src/performance/PERF_PV_FITS.test.ts | 2 +- src/performance/PERF_PV_HDF5.test.ts | 2 +- src/performance/PERF_REGION_SPECTRAL_PROFILE_CASA.test.ts | 4 ++-- src/performance/PERF_REGION_SPECTRAL_PROFILE_FITS.test.ts | 4 ++-- src/performance/PERF_REGION_SPECTRAL_PROFILE_HDF5.test.ts | 4 ++-- src/test/config.json | 6 +++--- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/performance/PERF_ANIMATOR_CONTOUR_CASA.test.ts b/src/performance/PERF_ANIMATOR_CONTOUR_CASA.test.ts index 711bc4b..b9a49b5 100644 --- a/src/performance/PERF_ANIMATOR_CONTOUR_CASA.test.ts +++ b/src/performance/PERF_ANIMATOR_CONTOUR_CASA.test.ts @@ -8,8 +8,8 @@ import { take } from 'rxjs/operators'; let connectTimeout = config.timeout.connection; let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; -let openFileTimeout: number = config.timeout.openFile; -let readFileTimeout: number = config.timeout.readFile; +let openFileTimeout: number = config.performance.openFile; +let readFileTimeout: number = config.performance.readFile; let playAnimatorTimeout = config.performance.playAnimator; interface AssertItem { diff --git a/src/performance/PERF_ANIMATOR_CONTOUR_FITS.test.ts b/src/performance/PERF_ANIMATOR_CONTOUR_FITS.test.ts index f69dcb1..3c66852 100644 --- a/src/performance/PERF_ANIMATOR_CONTOUR_FITS.test.ts +++ b/src/performance/PERF_ANIMATOR_CONTOUR_FITS.test.ts @@ -8,8 +8,8 @@ import { take } from 'rxjs/operators'; let connectTimeout = config.timeout.connection; let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; -let openFileTimeout: number = config.timeout.openFile; -let readFileTimeout: number = config.timeout.readFile; +let openFileTimeout: number = config.performance.openFile; +let readFileTimeout: number = config.performance.readFile; let playAnimatorTimeout = config.performance.playAnimator; interface AssertItem { diff --git a/src/performance/PERF_ANIMATOR_CONTOUR_HDF5.test.ts b/src/performance/PERF_ANIMATOR_CONTOUR_HDF5.test.ts index c433cb7..c798328 100644 --- a/src/performance/PERF_ANIMATOR_CONTOUR_HDF5.test.ts +++ b/src/performance/PERF_ANIMATOR_CONTOUR_HDF5.test.ts @@ -8,8 +8,8 @@ import { take } from 'rxjs/operators'; let connectTimeout = config.timeout.connection; let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; -let openFileTimeout: number = config.timeout.openFile; -let readFileTimeout: number = config.timeout.readFile; +let openFileTimeout: number = config.performance.openFile; +let readFileTimeout: number = config.performance.readFile; let playAnimatorTimeout = config.performance.playAnimator; interface AssertItem { diff --git a/src/performance/PERF_CONTOUR_DATA_Mode0.test.ts b/src/performance/PERF_CONTOUR_DATA_Mode0.test.ts index 0a6575a..8d8f1e2 100644 --- a/src/performance/PERF_CONTOUR_DATA_Mode0.test.ts +++ b/src/performance/PERF_CONTOUR_DATA_Mode0.test.ts @@ -7,7 +7,7 @@ let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; let openFileTimeout: number = config.performance.openFile; -let readFileTimeout: number = config.timeout.readFile; +let readFileTimeout: number = config.performance.readFile; let playContourTimeout: number = config.performance.playContour; interface AssertItem { diff --git a/src/performance/PERF_CONTOUR_DATA_Mode1.test.ts b/src/performance/PERF_CONTOUR_DATA_Mode1.test.ts index ed3816d..3cae8c1 100644 --- a/src/performance/PERF_CONTOUR_DATA_Mode1.test.ts +++ b/src/performance/PERF_CONTOUR_DATA_Mode1.test.ts @@ -7,7 +7,7 @@ let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; let openFileTimeout: number = config.performance.openFile; -let readFileTimeout: number = config.timeout.readFile; +let readFileTimeout: number = config.performance.readFile; let playContourTimeout: number = config.performance.playContour; interface AssertItem { diff --git a/src/performance/PERF_CONTOUR_DATA_Mode2.test.ts b/src/performance/PERF_CONTOUR_DATA_Mode2.test.ts index a82413f..7218753 100644 --- a/src/performance/PERF_CONTOUR_DATA_Mode2.test.ts +++ b/src/performance/PERF_CONTOUR_DATA_Mode2.test.ts @@ -7,7 +7,7 @@ let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; let openFileTimeout: number = config.performance.openFile; -let readFileTimeout: number = config.timeout.readFile; +let readFileTimeout: number = config.performance.readFile; let playContourTimeout: number = config.performance.playContour; interface AssertItem { diff --git a/src/performance/PERF_LOAD_IMAGE_CASA.test.ts b/src/performance/PERF_LOAD_IMAGE_CASA.test.ts index ada8139..4e1056a 100644 --- a/src/performance/PERF_LOAD_IMAGE_CASA.test.ts +++ b/src/performance/PERF_LOAD_IMAGE_CASA.test.ts @@ -7,7 +7,7 @@ let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; let openFileTimeout: number = config.performance.openFile; -let readFileTimeout: number = config.timeout.readFile; +let readFileTimeout: number = config.performance.readFile; interface AssertItem { fileOpen: CARTA.IOpenFile[]; diff --git a/src/performance/PERF_LOAD_IMAGE_FITS.test.ts b/src/performance/PERF_LOAD_IMAGE_FITS.test.ts index a2a5dfe..eae38dd 100644 --- a/src/performance/PERF_LOAD_IMAGE_FITS.test.ts +++ b/src/performance/PERF_LOAD_IMAGE_FITS.test.ts @@ -7,7 +7,7 @@ let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; let openFileTimeout: number = config.performance.openFile; -let readFileTimeout: number = config.timeout.readFile; +let readFileTimeout: number = config.performance.readFile; interface AssertItem { fileOpen: CARTA.IOpenFile[]; diff --git a/src/performance/PERF_LOAD_IMAGE_HDF5.test.ts b/src/performance/PERF_LOAD_IMAGE_HDF5.test.ts index 629be65..89fb7ec 100644 --- a/src/performance/PERF_LOAD_IMAGE_HDF5.test.ts +++ b/src/performance/PERF_LOAD_IMAGE_HDF5.test.ts @@ -7,7 +7,7 @@ let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; let openFileTimeout: number = config.performance.openFile; -let readFileTimeout: number = config.timeout.readFile; +let readFileTimeout: number = config.performance.readFile; interface AssertItem { fileOpen: CARTA.IOpenFile[]; diff --git a/src/performance/PERF_PV_CASA.test.ts b/src/performance/PERF_PV_CASA.test.ts index afc9ee0..b75d0fa 100644 --- a/src/performance/PERF_PV_CASA.test.ts +++ b/src/performance/PERF_PV_CASA.test.ts @@ -6,7 +6,7 @@ import config from '../test/config.json'; let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; -let openFileTimeout: number = config.timeout.openFile; +let openFileTimeout: number = config.performance.openFile; let PVTimeout: number = config.performance.pvTimeout; interface AssertItem { diff --git a/src/performance/PERF_PV_FITS.test.ts b/src/performance/PERF_PV_FITS.test.ts index 2c751d1..d40e280 100644 --- a/src/performance/PERF_PV_FITS.test.ts +++ b/src/performance/PERF_PV_FITS.test.ts @@ -6,7 +6,7 @@ import config from '../test/config.json'; let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; -let openFileTimeout: number = config.timeout.openFile; +let openFileTimeout: number = config.performance.openFile; let PVTimeout: number = config.performance.pvTimeout; interface AssertItem { diff --git a/src/performance/PERF_PV_HDF5.test.ts b/src/performance/PERF_PV_HDF5.test.ts index fba507b..21776b3 100644 --- a/src/performance/PERF_PV_HDF5.test.ts +++ b/src/performance/PERF_PV_HDF5.test.ts @@ -6,7 +6,7 @@ import config from '../test/config.json'; let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; -let openFileTimeout: number = config.timeout.openFile; +let openFileTimeout: number = config.performance.openFile; let PVTimeout: number = config.performance.pvTimeout; interface AssertItem { diff --git a/src/performance/PERF_REGION_SPECTRAL_PROFILE_CASA.test.ts b/src/performance/PERF_REGION_SPECTRAL_PROFILE_CASA.test.ts index 6bdfa5f..6429f4d 100644 --- a/src/performance/PERF_REGION_SPECTRAL_PROFILE_CASA.test.ts +++ b/src/performance/PERF_REGION_SPECTRAL_PROFILE_CASA.test.ts @@ -6,8 +6,8 @@ import config from '../test/config.json'; let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; -let openFileTimeout: number = config.timeout.openFile; -let readFileTimeout: number = config.timeout.readFile; +let openFileTimeout: number = config.performance.openFile; +let readFileTimeout: number = config.performance.readFile; let readRegionTimeout: number = config.timeout.region; let spectralProfileTimeout: number = 120000; diff --git a/src/performance/PERF_REGION_SPECTRAL_PROFILE_FITS.test.ts b/src/performance/PERF_REGION_SPECTRAL_PROFILE_FITS.test.ts index 95799b4..d7e4dad 100644 --- a/src/performance/PERF_REGION_SPECTRAL_PROFILE_FITS.test.ts +++ b/src/performance/PERF_REGION_SPECTRAL_PROFILE_FITS.test.ts @@ -6,8 +6,8 @@ import config from '../test/config.json'; let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; -let openFileTimeout: number = config.timeout.openFile; -let readFileTimeout: number = config.timeout.readFile; +let openFileTimeout: number = config.performance.openFile; +let readFileTimeout: number = config.performance.readFile; let readRegionTimeout: number = config.timeout.region; let spectralProfileTimeout: number = 120000; diff --git a/src/performance/PERF_REGION_SPECTRAL_PROFILE_HDF5.test.ts b/src/performance/PERF_REGION_SPECTRAL_PROFILE_HDF5.test.ts index 52f419c..6daba2e 100644 --- a/src/performance/PERF_REGION_SPECTRAL_PROFILE_HDF5.test.ts +++ b/src/performance/PERF_REGION_SPECTRAL_PROFILE_HDF5.test.ts @@ -6,8 +6,8 @@ import config from '../test/config.json'; let testServerUrl: string = config.serverURL0; let testSubdirectory: string = config.path.performance; let connectTimeout: number = config.timeout.connection; -let openFileTimeout: number = config.timeout.openFile; -let readFileTimeout: number = config.timeout.readFile; +let openFileTimeout: number = config.performance.openFile; +let readFileTimeout: number = config.performance.readFile; let readRegionTimeout: number = config.timeout.region; let spectralProfileTimeout: number = 120000; diff --git a/src/test/config.json b/src/test/config.json index 80bd405..1902afa 100644 --- a/src/test/config.json +++ b/src/test/config.json @@ -18,11 +18,11 @@ "compressed_fits": "set_compressed_fits" }, "performance": { - "openFile": 16000, - "readFile": 5000, + "openFile": 20000, + "readFile": 10000, "playContour": 12000, "playAnimator": 300000, - "setSpectralReqTimeout": 5000, + "setSpectralReqTimeout": 10000, "momentTimeout": 400000, "pvTimeout": 200000 }, From 2dd4da05c6d60b2f86e153baae85094ff2e6150b Mon Sep 17 00:00:00 2001 From: Cheng-Chin Chiang Date: Mon, 26 Jan 2026 11:13:45 +0800 Subject: [PATCH 3/6] Add script files --- scripts/fix_code_style.sh | 9 ++++++++ scripts/recompile.sh | 8 +++++++ scripts/run_icd_tests_all.sh | 25 +++++++++++++++++++++ scripts/run_icd_tests_specific.sh | 13 +++++++++++ scripts/run_icd_tests_stage.sh | 23 +++++++++++++++++++ scripts/run_perf_tests_all.sh | 4 ++++ scripts/run_perf_tests_specific.sh | 36 ++++++++++++++++++++++++++++++ 7 files changed, 118 insertions(+) create mode 100755 scripts/fix_code_style.sh create mode 100755 scripts/recompile.sh create mode 100755 scripts/run_icd_tests_all.sh create mode 100755 scripts/run_icd_tests_specific.sh create mode 100755 scripts/run_icd_tests_stage.sh create mode 100755 scripts/run_perf_tests_all.sh create mode 100755 scripts/run_perf_tests_specific.sh diff --git a/scripts/fix_code_style.sh b/scripts/fix_code_style.sh new file mode 100755 index 0000000..67f047c --- /dev/null +++ b/scripts/fix_code_style.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# +# Need to install the prettier package first +# +#npm install --save-dev prettier + +npx prettier --write ../src/test +npx prettier --write ../src/performance diff --git a/scripts/recompile.sh b/scripts/recompile.sh new file mode 100755 index 0000000..d6012c3 --- /dev/null +++ b/scripts/recompile.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +cd .. +npm install + +cd protobuf +./build_proto.sh + diff --git a/scripts/run_icd_tests_all.sh b/scripts/run_icd_tests_all.sh new file mode 100755 index 0000000..5271aed --- /dev/null +++ b/scripts/run_icd_tests_all.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# -------------------------------------------------------------------------------------------------- +# ls ../ICD_test_stages +# +# animator.tests file_browser.tests pv_generator.tests resume.tests +# catalog.tests image_fitting.tests raster_tiles.tests vector_overlay.tests +# close_file.tests match.tests region_manipulation.tests +# cube_histogram.tests moment.tests region_statistics.tests +# -------------------------------------------------------------------------------------------------- + +./run_icd_tests_stage.sh animator +./run_icd_tests_stage.sh catalog +./run_icd_tests_stage.sh close_file +./run_icd_tests_stage.sh cube_histogram +./run_icd_tests_stage.sh file_browser +./run_icd_tests_stage.sh image_fitting +./run_icd_tests_stage.sh match +./run_icd_tests_stage.sh moment +./run_icd_tests_stage.sh pv_generator +./run_icd_tests_stage.sh raster_tiles +./run_icd_tests_stage.sh region_manipulation +./run_icd_tests_stage.sh region_statistics +./run_icd_tests_stage.sh resume +./run_icd_tests_stage.sh vector_overlay diff --git a/scripts/run_icd_tests_specific.sh b/scripts/run_icd_tests_specific.sh new file mode 100755 index 0000000..17db549 --- /dev/null +++ b/scripts/run_icd_tests_specific.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e # stop on first failure + +BASE="src/test" + +TESTS=( + CHANNEL_MAP.test.ts +) + +for test in "${TESTS[@]}"; do + npm test "$BASE/$test" +done + diff --git a/scripts/run_icd_tests_stage.sh b/scripts/run_icd_tests_stage.sh new file mode 100755 index 0000000..87c2b30 --- /dev/null +++ b/scripts/run_icd_tests_stage.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# -------------------------------------------------------------------------------------------------- +# ls ../ICD_test_stages +# +# animator.tests file_browser.tests pv_generator.tests resume.tests +# catalog.tests image_fitting.tests raster_tiles.tests vector_overlay.tests +# close_file.tests match.tests region_manipulation.tests +# cube_histogram.tests moment.tests region_statistics.tests +# -------------------------------------------------------------------------------------------------- + +# -------------------------------------------------------------------------------------------------- +# Example: +# ./run_icd_tests_stage.sh animator +# -------------------------------------------------------------------------------------------------- + +TEST_CLASS=$1 + +for test_file in $(cat ../ICD_test_stages/$TEST_CLASS.tests); do + # echo $test_file + npm test $test_file + # sleep 3 && pgrep carta_backend +done diff --git a/scripts/run_perf_tests_all.sh b/scripts/run_perf_tests_all.sh new file mode 100755 index 0000000..e9036c7 --- /dev/null +++ b/scripts/run_perf_tests_all.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e # stop on first failure + +CI=true npm test -- src/performance > perf-test.log 2>&1 diff --git a/scripts/run_perf_tests_specific.sh b/scripts/run_perf_tests_specific.sh new file mode 100755 index 0000000..6639850 --- /dev/null +++ b/scripts/run_perf_tests_specific.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -e # stop on first failure + +BASE="src/performance" + +TESTS=( + PERF_ANIMATOR_CONTOUR_CASA.test.ts + PERF_ANIMATOR_CONTOUR_FITS.test.ts + PERF_ANIMATOR_CONTOUR_HDF5.test.ts + PERF_CONTOUR_DATA_Mode0.test.ts + PERF_CONTOUR_DATA_Mode1.test.ts + PERF_CONTOUR_DATA_Mode2.test.ts + PERF_CUBE_HISTOGRAM_CASA.test.ts + PERF_CUBE_HISTOGRAM_FITS.test.ts + PERF_CUBE_HISTOGRAM_HDF5.test.ts + PERF_LOAD_IMAGE_CASA.test.ts + PERF_LOAD_IMAGE_FITS.test.ts + PERF_LOAD_IMAGE_HDF5.test.ts + PERF_MOMENTS_CASA.test.ts + PERF_MOMENTS_FITS.test.ts + PERF_MOMENTS_HDF5.test.ts + PERF_PV_CASA.test.ts + PERF_PV_FITS.test.ts + PERF_PV_HDF5.test.ts + PERF_RASTER_TILE_DATA_CASA.test.ts + PERF_RASTER_TILE_DATA_FITS.test.ts + PERF_RASTER_TILE_DATA_HDF5.test.ts + PERF_REGION_SPECTRAL_PROFILE_CASA.test.ts + PERF_REGION_SPECTRAL_PROFILE_FITS.test.ts + PERF_REGION_SPECTRAL_PROFILE_HDF5.test.ts +) + +for test in "${TESTS[@]}"; do + npm test "$BASE/$test" +done + From 74cde37d0a950ed78be0bcf873392322a30bee36 Mon Sep 17 00:00:00 2001 From: Cheng-Chin Chiang Date: Mon, 26 Jan 2026 13:23:29 +0800 Subject: [PATCH 4/6] Add a performance log parser --- scripts/parse_perf_log.sh | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 scripts/parse_perf_log.sh diff --git a/scripts/parse_perf_log.sh b/scripts/parse_perf_log.sh new file mode 100755 index 0000000..5decc5a --- /dev/null +++ b/scripts/parse_perf_log.sh @@ -0,0 +1,55 @@ +#!/bin/bash +set -euo pipefail + +FILE="${1:-}" + +if [[ -z "$FILE" || ! -f "$FILE" ]]; then + echo "Usage: $0 " + exit 1 +fi + +awk ' +BEGIN { + # ------------------------------------------ + # Define target texts (edit freely) + # ------------------------------------------ + targets[1] = "Image should return one after one and the last channel is correct:" + targets[2] = "Receive a series of moment progress within" + targets[3] = "PV Response should arrived within" + targets[4] = "SPECTRAL_PROFILE_DATA stream should arrive within" + targets[5] = "ContourImageData responses should arrive within" + targets[6] = "REGION_HISTOGRAM_DATA should arrive completely within" + targets[7] = "RasterTileData responses should arrive within" + targets[8] = "OPEN_FILE_ACK and REGION_HISTOGRAM_DATA should arrive within" + + # ------------------------------------------ + # Automatically count targets + # ------------------------------------------ + ntargets = 0 + for (i in targets) { + ntargets++ + } +} + +/^PASS / { + pass_line = $0 + next +} + +{ + for (i = 1; i <= ntargets; i++) { + t = targets[i] + if (index($0, t)) { + + if (match($0, /\([0-9]+ ms\)/)) { + s = substr($0, RSTART, RLENGTH) + gsub(/[()]/, "", s) + gsub(/ ms/, "", s) + print pass_line " -> " t " -> " s " ms" + } else { + print pass_line " -> " t " -> (no time found)" + } + } + } +} +' "$FILE" From e849c62e6911397b61d1ed4af1ac33631c7cc78d Mon Sep 17 00:00:00 2001 From: Cheng-Chin Chiang Date: Mon, 26 Jan 2026 14:27:50 +0800 Subject: [PATCH 5/6] Refine performance test output and parser --- scripts/parse_perf_log.sh | 17 +++++++++-------- .../PERF_ANIMATOR_CONTOUR_CASA.test.ts | 4 ++-- .../PERF_ANIMATOR_CONTOUR_FITS.test.ts | 4 ++-- .../PERF_ANIMATOR_CONTOUR_HDF5.test.ts | 4 ++-- src/performance/PERF_LOAD_IMAGE_CASA.test.ts | 4 ++-- src/performance/PERF_LOAD_IMAGE_FITS.test.ts | 4 ++-- src/performance/PERF_LOAD_IMAGE_HDF5.test.ts | 4 ++-- 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/scripts/parse_perf_log.sh b/scripts/parse_perf_log.sh index 5decc5a..a914951 100755 --- a/scripts/parse_perf_log.sh +++ b/scripts/parse_perf_log.sh @@ -13,14 +13,15 @@ BEGIN { # ------------------------------------------ # Define target texts (edit freely) # ------------------------------------------ - targets[1] = "Image should return one after one and the last channel is correct:" - targets[2] = "Receive a series of moment progress within" - targets[3] = "PV Response should arrived within" - targets[4] = "SPECTRAL_PROFILE_DATA stream should arrive within" - targets[5] = "ContourImageData responses should arrive within" - targets[6] = "REGION_HISTOGRAM_DATA should arrive completely within" - targets[7] = "RasterTileData responses should arrive within" - targets[8] = "OPEN_FILE_ACK and REGION_HISTOGRAM_DATA should arrive within" + targets[1] = "(Play forward) Image should return one after one and the last channel is correct" + targets[2] = "(Play backward) Image should return one after one and the last channel is correct" + targets[3] = "Receive a series of moment progress within" + targets[4] = "PV Response should arrived within" + targets[5] = "SPECTRAL_PROFILE_DATA stream should arrive within" + targets[6] = "ContourImageData responses should arrive within" + targets[7] = "REGION_HISTOGRAM_DATA should arrive completely within" + targets[8] = "RasterTileData responses should arrive within" + targets[9] = "(PERF_LOAD_IMAGE) OPEN_FILE_ACK and REGION_HISTOGRAM_DATA should arrive within" # ------------------------------------------ # Automatically count targets diff --git a/src/performance/PERF_ANIMATOR_CONTOUR_CASA.test.ts b/src/performance/PERF_ANIMATOR_CONTOUR_CASA.test.ts index b9a49b5..fc853e8 100644 --- a/src/performance/PERF_ANIMATOR_CONTOUR_CASA.test.ts +++ b/src/performance/PERF_ANIMATOR_CONTOUR_CASA.test.ts @@ -201,7 +201,7 @@ describe('ANIMATOR_CONTOUR: Testing animation playback with contour lines', () = let HistogramSequence: number[] = []; let ContourSequence: number[] = []; test( - `Image should return one after one and the last channel is correct:`, + `(Play forward) Image should return one after one and the last channel is correct`, async () => { let StartAnimationResponse: CARTA.IStartAnimationAck; StartAnimationResponse = await msgController.startAnimation(assertItem.startAnimation[0]); @@ -362,7 +362,7 @@ describe('ANIMATOR_CONTOUR: Testing animation playback with contour lines', () = let HistogramSequence: number[] = []; let ContourSequence: number[] = []; test( - `Image should return one after one and the last channel is correct:`, + `(Play backward) Image should return one after one and the last channel is correct`, async () => { let StartAnimationResponse: CARTA.IStartAnimationAck; StartAnimationResponse = await msgController.startAnimation(assertItem.startAnimation[1]); diff --git a/src/performance/PERF_ANIMATOR_CONTOUR_FITS.test.ts b/src/performance/PERF_ANIMATOR_CONTOUR_FITS.test.ts index 3c66852..2721ac2 100644 --- a/src/performance/PERF_ANIMATOR_CONTOUR_FITS.test.ts +++ b/src/performance/PERF_ANIMATOR_CONTOUR_FITS.test.ts @@ -201,7 +201,7 @@ describe('ANIMATOR_CONTOUR: Testing animation playback with contour lines', () = let HistogramSequence: number[] = []; let ContourSequence: number[] = []; test( - `Image should return one after one and the last channel is correct:`, + `(Play forward) Image should return one after one and the last channel is correct`, async () => { let StartAnimationResponse: CARTA.IStartAnimationAck; StartAnimationResponse = await msgController.startAnimation(assertItem.startAnimation[0]); @@ -362,7 +362,7 @@ describe('ANIMATOR_CONTOUR: Testing animation playback with contour lines', () = let HistogramSequence: number[] = []; let ContourSequence: number[] = []; test( - `Image should return one after one and the last channel is correct:`, + `(Play backward) Image should return one after one and the last channel is correct`, async () => { let StartAnimationResponse: CARTA.IStartAnimationAck; StartAnimationResponse = await msgController.startAnimation(assertItem.startAnimation[1]); diff --git a/src/performance/PERF_ANIMATOR_CONTOUR_HDF5.test.ts b/src/performance/PERF_ANIMATOR_CONTOUR_HDF5.test.ts index c798328..24d56c7 100644 --- a/src/performance/PERF_ANIMATOR_CONTOUR_HDF5.test.ts +++ b/src/performance/PERF_ANIMATOR_CONTOUR_HDF5.test.ts @@ -201,7 +201,7 @@ describe('ANIMATOR_CONTOUR: Testing animation playback with contour lines', () = let HistogramSequence: number[] = []; let ContourSequence: number[] = []; test( - `Image should return one after one and the last channel is correct:`, + `(Play forward) Image should return one after one and the last channel is correct`, async () => { let StartAnimationResponse: CARTA.IStartAnimationAck; StartAnimationResponse = await msgController.startAnimation(assertItem.startAnimation[0]); @@ -362,7 +362,7 @@ describe('ANIMATOR_CONTOUR: Testing animation playback with contour lines', () = let HistogramSequence: number[] = []; let ContourSequence: number[] = []; test( - `Image should return one after one and the last channel is correct:`, + `(Play backward) Image should return one after one and the last channel is correct`, async () => { let StartAnimationResponse: CARTA.IStartAnimationAck; StartAnimationResponse = await msgController.startAnimation(assertItem.startAnimation[1]); diff --git a/src/performance/PERF_LOAD_IMAGE_CASA.test.ts b/src/performance/PERF_LOAD_IMAGE_CASA.test.ts index 4e1056a..f3a21b7 100644 --- a/src/performance/PERF_LOAD_IMAGE_CASA.test.ts +++ b/src/performance/PERF_LOAD_IMAGE_CASA.test.ts @@ -63,7 +63,7 @@ describe('PERF_LOAD_IMAGE', () => { describe(`Initialization: open the image`, () => { test( - `(Step 1)"${assertItem.fileOpen[0].file}" OPEN_FILE_ACK and REGION_HISTOGRAM_DATA should arrive within ${openFileTimeout} ms`, + `"${assertItem.fileOpen[0].file}" (PERF_LOAD_IMAGE) OPEN_FILE_ACK and REGION_HISTOGRAM_DATA should arrive within ${openFileTimeout} ms`, async () => { msgController.closeFile(-1); msgController.closeFile(0); @@ -75,7 +75,7 @@ describe('PERF_LOAD_IMAGE', () => { ); test( - `(Step 1)"${assertItem.fileOpen[0].file}" SetImageChannels & SetCursor responses should arrive within ${readFileTimeout} ms`, + `"${assertItem.fileOpen[0].file}" (PERF_LOAD_IMAGE) SetImageChannels & SetCursor responses should arrive within ${readFileTimeout} ms`, async () => { msgController.addRequiredTiles(assertItem.initTilesReq); let RasterTileDataResponse = await Stream( diff --git a/src/performance/PERF_LOAD_IMAGE_FITS.test.ts b/src/performance/PERF_LOAD_IMAGE_FITS.test.ts index eae38dd..ae4acdf 100644 --- a/src/performance/PERF_LOAD_IMAGE_FITS.test.ts +++ b/src/performance/PERF_LOAD_IMAGE_FITS.test.ts @@ -63,7 +63,7 @@ describe('PERF_LOAD_IMAGE', () => { describe(`Initialization: open the image`, () => { test( - `(Step 1)"${assertItem.fileOpen[0].file}" OPEN_FILE_ACK and REGION_HISTOGRAM_DATA should arrive within ${openFileTimeout} ms`, + `"${assertItem.fileOpen[0].file}" (PERF_LOAD_IMAGE) OPEN_FILE_ACK and REGION_HISTOGRAM_DATA should arrive within ${openFileTimeout} ms`, async () => { msgController.closeFile(-1); msgController.closeFile(0); @@ -75,7 +75,7 @@ describe('PERF_LOAD_IMAGE', () => { ); test( - `(Step 1)"${assertItem.fileOpen[0].file}" SetImageChannels & SetCursor responses should arrive within ${readFileTimeout} ms`, + `"${assertItem.fileOpen[0].file}" (PERF_LOAD_IMAGE) SetImageChannels & SetCursor responses should arrive within ${readFileTimeout} ms`, async () => { msgController.addRequiredTiles(assertItem.initTilesReq); let RasterTileDataResponse = await Stream( diff --git a/src/performance/PERF_LOAD_IMAGE_HDF5.test.ts b/src/performance/PERF_LOAD_IMAGE_HDF5.test.ts index 89fb7ec..08faf5e 100644 --- a/src/performance/PERF_LOAD_IMAGE_HDF5.test.ts +++ b/src/performance/PERF_LOAD_IMAGE_HDF5.test.ts @@ -63,7 +63,7 @@ describe('PERF_LOAD_IMAGE', () => { describe(`Initialization: open the image`, () => { test( - `(Step 1)"${assertItem.fileOpen[0].file}" OPEN_FILE_ACK and REGION_HISTOGRAM_DATA should arrive within ${openFileTimeout} ms`, + `"${assertItem.fileOpen[0].file}" (PERF_LOAD_IMAGE) OPEN_FILE_ACK and REGION_HISTOGRAM_DATA should arrive within ${openFileTimeout} ms`, async () => { msgController.closeFile(-1); msgController.closeFile(0); @@ -75,7 +75,7 @@ describe('PERF_LOAD_IMAGE', () => { ); test( - `(Step 1)"${assertItem.fileOpen[0].file}" SetImageChannels & SetCursor responses should arrive within ${readFileTimeout} ms`, + `"${assertItem.fileOpen[0].file}" (PERF_LOAD_IMAGE) SetImageChannels & SetCursor responses should arrive within ${readFileTimeout} ms`, async () => { msgController.addRequiredTiles(assertItem.initTilesReq); let RasterTileDataResponse = await Stream( From 191c8e22ef36959bd00c903cd8faaf057d624c0d Mon Sep 17 00:00:00 2001 From: Cheng-Chin Chiang Date: Tue, 27 Jan 2026 00:16:55 +0800 Subject: [PATCH 6/6] Add a script to get performance results --- scripts/get_perf_results.sh | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 scripts/get_perf_results.sh diff --git a/scripts/get_perf_results.sh b/scripts/get_perf_results.sh new file mode 100755 index 0000000..73b3fbb --- /dev/null +++ b/scripts/get_perf_results.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -euo pipefail + +FILE="${1:-}" +if [[ -z "$FILE" || ! -f "$FILE" ]]; then + echo "Usage: $0 " + exit 2 +fi + +get_time_by_key() { + local key="$1" + local ms + ms="$(grep -F -- "$key" "$FILE" | head -n 1 | sed -E 's/.*-> ([0-9]+) ms/\1/')" + printf '%s %s ms\n' "$key" "$ms" +} + +get_time_by_key "PERF_ANIMATOR_CONTOUR_CASA.test.ts" +get_time_by_key "PERF_ANIMATOR_CONTOUR_HDF5.test.ts" +get_time_by_key "PERF_ANIMATOR_CONTOUR_FITS.test.ts" +get_time_by_key "PERF_MOMENTS_CASA.test.ts" +get_time_by_key "PERF_MOMENTS_FITS.test.ts" +get_time_by_key "PERF_MOMENTS_HDF5.test.ts" +get_time_by_key "PERF_PV_CASA.test.ts" +get_time_by_key "PERF_PV_HDF5.test.ts" +get_time_by_key "PERF_PV_FITS.test.ts" +get_time_by_key "PERF_REGION_SPECTRAL_PROFILE_CASA.test.ts" +get_time_by_key "PERF_REGION_SPECTRAL_PROFILE_HDF5.test.ts" +get_time_by_key "PERF_REGION_SPECTRAL_PROFILE_FITS.test.ts" +get_time_by_key "PERF_CONTOUR_DATA_Mode2.test.ts" +get_time_by_key "PERF_CONTOUR_DATA_Mode0.test.ts" +get_time_by_key "PERF_CONTOUR_DATA_Mode1.test.ts" +get_time_by_key "PERF_CUBE_HISTOGRAM_CASA.test.ts" +get_time_by_key "PERF_CUBE_HISTOGRAM_FITS.test.ts" +get_time_by_key "PERF_CUBE_HISTOGRAM_HDF5.test.ts" +get_time_by_key "PERF_RASTER_TILE_DATA_CASA.test.ts" +get_time_by_key "PERF_RASTER_TILE_DATA_FITS.test.ts" +get_time_by_key "PERF_RASTER_TILE_DATA_HDF5.test.ts" +get_time_by_key "PERF_LOAD_IMAGE_CASA.test.ts" +get_time_by_key "PERF_LOAD_IMAGE_HDF5.test.ts" +get_time_by_key "PERF_LOAD_IMAGE_FITS.test.ts"