Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented a performance data graphing module for batch mode #272

Merged
merged 5 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implemented minor changes
  • Loading branch information
rayyang29 committed Jul 5, 2022
commit 402d5bc0f0755b1e3e67c488fbf4ca2947333d52
6 changes: 1 addition & 5 deletions docker/hapi-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ services:
container_name: hapi-server
environment:
- hapi.fhir.mdm_enabled=false
- hapi.fhir.enforce_referential_integrity_on_delete=false
- hapi.fhir.enforce_referential_integrity_on_write=false
- spring.datasource.url=jdbc:postgresql://db:5432/hapi
- spring.datasource.username=admin
- spring.datasource.password=admin
Expand All @@ -43,9 +41,7 @@ services:
restart: unless-stopped
ports:
- 8098:8080
volumes:
- hapi-server:/data/hapi


volumes:
hapi-fhir-db:
hapi-server:
Expand Down
13 changes: 7 additions & 6 deletions utils/resource-monitor/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Resource performance monitoring and graphing module

This is a module for monitoring the resource usage of the batch pipeline with [HAPI](https://hapifhir.io/)
This is a module for monitoring the resource usage of the batch pipeline with [HAPI FHIR](https://hapifhir.io/)
as the source. The scripts in this module generate graphs and csv files of resource usage
(CPU, memory and I/O) of the HAPI server, postgres database and pipeline over the duration of the
(CPU, memory and I/O) of the HAPI server, PostgreSQL database and pipeline over the duration of the
batch job. The user is able to specify the number of processes/cores used in the pipeline to assess
the batch pipeline's performance on the local machine.

Expand All @@ -11,11 +11,12 @@ the batch pipeline's performance on the local machine.
- Ensure you are able to run the `docker` command
[as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/). If not, run
`sudo chmod 666 /var/run/docker.sock`
- A [HAPI](https://hapifhir.io/) instance with a [postgres](https://www.postgresql.org/) instance
as its database. For convenience, [`this`](/docker/hapi-compose.yml) .yml file in the in the
- A [HAPI](https://hapifhir.io/) instance with a [PostgreSQL](https://www.postgresql.org/) instance
as its database. For convenience, [`hapi-compose.yml`](/docker/hapi-compose.yml) file in the in the
[`docker`](/docker) directory contains images of a HAPI server using postrges as its database. Start
the docker container with
`docker-compose -f hapi-compose.yml up`
`docker-compose -f hapi-compose.yml up`
- To upload sample data in the HAPI sever, please refer to this [`document`](/synthea-hiv/README.md).

## Graphing module

Expand All @@ -37,7 +38,7 @@ python3 graph_pidstat.py \

The output graphs can be found in the output results directory specified by the user;
the default is `/tmp/hapi-performance/`. The graphs visualize the CPU, memory and I/O usage of the
HAPI server, postgres database and pipeline over the duration of the batch job.
HAPI server, PostgreSQL database and pipeline over the duration of the batch job.

## Automating runs with different number of cores

Expand Down
2 changes: 1 addition & 1 deletion utils/resource-monitor/auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [[ "$#" -ne 6 ]]; then
printf '%s\n' \
"Error: Illegal number of arguments. " \
"Example usage: " \
"sh auto.sh [data description] [output parquet path] [output results path] [num processes increment] [lower core limit] [upper core limit]"
"sh $0 [data description] [output parquet path] [output results path] [num processes increment] [lower core limit] [upper core limit]"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion utils/resource-monitor/graph_pidstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_machine_mem() -> int:
None

Returns:
Integer representation of the local machine RAM in MBs
Integer representation of the local machine RAM in GBs
"""
mem_info = subprocess.run(
["grep", "MemTotal", "/proc/meminfo"], stdout=subprocess.PIPE
Expand Down