Skip to content

Commit

Permalink
Increase time measurement precision (#14)
Browse files Browse the repository at this point in the history
- Increases time measurement precision and update readme
  • Loading branch information
kcheeeung authored Sep 10, 2021
1 parent f2a1fd3 commit 99c003c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Steps to use

## Prerequisites
- Hadoop 2.2 or later cluster or Sandbox.
- Hadoop 3.1 or later cluster.
- Apache Hive.
- Between 15 minutes and 2 days to generate data (depending on the Scale Factor you choose and available hardware).
- Have ```gcc``` in installed your system path. If your system does not have it, install it using yum or apt-get.
- Have the following packages. If your system does not have it, install it using apt-get or similar.
```
bc, date, gcc, nohup, python3, timeout, zip
```

## Clone
```
git clone https://github.com/kcheeeung/hive-benchmark.git && cd hive-benchmark/
git clone https://github.com/kcheeeung/hive-benchmark.git
cd hive-benchmark/
```

# Individual Steps
Expand Down
6 changes: 3 additions & 3 deletions util_internalRunQuery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TIME_TO_TIMEOUT=120m
MODE='default'

# Beeline command to execute
START_TIME="$(date +%s)"
START_TIME="$(date +%s.%N)"

if [[ "${MODE}" == 'default' ]]; then
timeout "${TIME_TO_TIMEOUT}" beeline -u "jdbc:hive2://$(hostname -f):10001/${INTERNAL_DATABASE};transportMode=http" -i "${INTERNAL_SETTINGSPATH}" -f "${INTERNAL_QUERYPATH}" &>> "${INTERNAL_LOG_PATH}"
Expand All @@ -35,10 +35,10 @@ else
exit 1
fi

END_TIME="$(date +%s)"
END_TIME="$(date +%s.%N)"

if [[ "${RETURN_VAL}" == 0 ]]; then
secs_elapsed="$((END_TIME - START_TIME))"
secs_elapsed="$(echo "$END_TIME - $START_TIME" | bc -l)"
echo "${INTERNAL_QID}, ${secs_elapsed}, SUCCESS" >> "${INTERNAL_CSV}"
echo "query${INTERNAL_QID}: SUCCESS"
else
Expand Down

0 comments on commit 99c003c

Please sign in to comment.