-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-synchronized-experiments.sh
More file actions
executable file
·62 lines (52 loc) · 2.52 KB
/
Copy pathrun-synchronized-experiments.sh
File metadata and controls
executable file
·62 lines (52 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Run all three approaches with synchronized 3-minute duration for fair comparison
echo "=== Running Synchronized Experiments at 0.1 Hz ==="
echo "Each experiment will run for exactly 3 minutes (180 seconds)"
echo ""
# Clean old logs
echo "Cleaning previous latency logs..."
> fetching_latency_log.csv
echo "window_number,query_registered_at,first_data_received_at,expected_window_close,last_obs_received_at,result_emitted_at,latency_from_query_reg_ms,latency_from_data_start_ms,latency_from_last_obs_ms,result_value" > fetching_latency_log.csv
> approximation_latency_log.csv
echo "window_number,query_registered_at,first_data_received_at,expected_window_close,last_data_received_at,result_emitted_at,latency_from_query_reg_ms,latency_from_data_start_ms,latency_from_last_data_ms,result_value" > approximation_latency_log.csv
> chunked_latency_log.csv
echo "window_number,query_registered_at,first_data_received_at,expected_window_close,last_chunk_received_at,interval_trigger_at,result_emitted_at,latency_from_query_reg_ms,latency_from_data_start_ms,interval_wait_ms,computation_ms,result_value" > chunked_latency_log.csv
echo ""
# Run Fetching
echo "node experiments/frequency-comparison/experiment-frequency-comparison-fetching.js test complex_oscillation 0.1"
node experiments/frequency-comparison/experiment-frequency-comparison-fetching.js test complex_oscillation 0.1 &
fetching_pid=$!
sleep 180
pkill -P $fetching_pid
kill $fetching_pid 2>/dev/null
echo "Fetching experiment completed"
echo ""
sleep 5
# Run Approximation
echo "node experiments/frequency-comparison/experiment-frequency-comparison-approximation.js test complex_oscillation 0.1"
node experiments/frequency-comparison/experiment-frequency-comparison-approximation.js test complex_oscillation 0.1 &
approx_pid=$!
sleep 180
pkill -P $approx_pid
kill $approx_pid 2>/dev/null
echo "Approximation experiment completed"
echo ""
sleep 5
# Run Chunked (uses different argument format - just frequency)
echo "node experiments/frequency-comparison/experiment-frequency-chunked-with-capture.js 0.1"
node experiments/frequency-comparison/experiment-frequency-chunked-with-capture.js 0.1 &
chunked_pid=$!
sleep 180
pkill -P $chunked_pid
kill $chunked_pid 2>/dev/null
echo "Chunked experiment completed"
echo ""
echo "=== All Experiments Completed ==="
echo ""
echo "Results:"
echo "Fetching windows:"
tail -n +2 fetching_latency_log.csv | wc -l
echo "Approximation windows:"
tail -n +2 approximation_latency_log.csv | wc -l
echo "Chunked windows:"
tail -n +2 chunked_latency_log.csv | wc -l