Skip to content

Commit 0bc7308

Browse files
Merge pull request #93 from AfricasVoices/run-mno-analysis-scripts
script to run mno analysis
2 parents 40628e7 + 4efab41 commit 0bc7308

4 files changed

+48
-3
lines changed

mno_analysis_tools/docker-run-compute-messages-per-period.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ done
2020

2121
# Check that the correct number of arguments were provided.
2222
if [[ $# -ne 7 ]]; then
23-
echo "Usage: ./docker-run-compute-window-of-downtime.sh
23+
echo "Usage: ./docker-run-compute-window-of-downtime.sh
24+
[--profile-memory <profile-output-path>]
2425
<raw_messages_file_path> <target_operator> <target_message_direction>
2526
<start_date> <end_date> <time_frame> <output_dir>"
2627
exit

mno_analysis_tools/docker-run-compute-msg-difference-btwn-two-firebase-time-periods.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ done
2020

2121
# Check that the correct number of arguments were provided.
2222
if [[ $# -lt 6 ]]; then
23-
echo "Usage: ./docker-run-compute-msg-difference-btwn-periods.sh
23+
echo "Usage: ./docker-run-compute-msg-difference-btwn-two-firebase-time-periods.sh
24+
[--profile-memory <profile-output-path>]
2425
<raw_messages_file_path> <target_operator> <target_message_direction>
2526
<start_date> <end_date> <output_dir> <time_frame>"
2627
exit

mno_analysis_tools/docker-run-compute-window-of-downtime.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ done
2020

2121
# Check that the correct number of arguments were provided.
2222
if [[ $# -ne 6 ]]; then
23-
echo "Usage: ./docker-run-compute-window-of-downtime.sh
23+
echo "Usage: ./docker-run-compute-window-of-downtime.sh
24+
[--profile-memory <profile-output-path>]
2425
<raw_messages_file_path> <target_operator> <target_message_direction>
2526
<start_date> <end_date> <output_dir>"
2627
exit
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [[ $# -ne 9 ]]; then
6+
echo "Usage: ./run-mno-analysis.sh"
7+
echo " [--profile-memory <profile-output-path>]"
8+
echo " <domain> <token> <raw_messages_file_path>"
9+
echo " <target_operator> <target_message_direction>"
10+
echo " <start_date> <end_date> <time_frame> <optional_time_frame>"
11+
echo " <output_dir>"
12+
echo "Runs the Mno Analysis end-to-end (Fetch Raw Messages, compute window of downtime,
13+
compute messages per period, compute msg difference btwn periods)"
14+
exit
15+
fi
16+
17+
DOMAIN=$1
18+
TOKEN=$2
19+
RAW_MESSAGES_FILE_PATH=$3
20+
TARGET_OPERATOR=$4
21+
TARGET_MESSAGE_DIRECTION=$5
22+
START_DATE=$6
23+
END_DATE=$7
24+
TIME_FRAME=$8
25+
OUTPUT_DIR=$9
26+
27+
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
28+
HASH=$(git rev-parse HEAD)
29+
RUN_ID="$DATE-$HASH"
30+
31+
echo "Starting run with id '$RUN_ID'"
32+
33+
./docker-run-fetch-raw-messages.sh --profile-memory ./data "$DOMAIN" "$TOKEN" "$OUTPUT_DIR"
34+
35+
./docker-run-compute-window-of-downtime.sh --profile-memory ./data "$RAW_MESSAGES_FILE_PATH" \
36+
"$TARGET_OPERATOR" "$TARGET_MESSAGE_DIRECTION" "$START_DATE" "$END_DATE" "$OUTPUT_DIR"
37+
38+
./docker-run-compute-messages-per-period.sh --profile-memory ./data "$RAW_MESSAGES_FILE_PATH" "$TARGET_OPERATOR" \
39+
"$TARGET_MESSAGE_DIRECTION" "$START_DATE" "$END_DATE" "$TIME_FRAME" "$OUTPUT_DIR"
40+
41+
./docker-run-compute-msg-difference-btwn-two-firebase-time-periods.sh --profile-memory ./data "$RAW_MESSAGES_FILE_PATH" \
42+
"$TARGET_OPERATOR" "$TARGET_MESSAGE_DIRECTION" "$START_DATE" "$END_DATE" "$OUTPUT_DIR"

0 commit comments

Comments
 (0)