Skip to content

Commit

Permalink
Merge pull request #30 from IATI/develop
Browse files Browse the repository at this point in the history
add zipper duration as prom metric
  • Loading branch information
simon-20 authored Dec 11, 2024
2 parents 8ee6155 + 9a6d315 commit cffcf55
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The example file is preconfigured to work with the local docker compose setup.

#### 4. Install some version of `dotenv` (optional)

The `.env` file is used when running things locally to store environment variables that configure the apps mentioned above. Docker Compose will read this automatically, but when running the bulk data service app or `yoyo` directly, you need to get these variables into the shell environment: you can either source this file to get the environment variables into your current terminal context, or you can one of the various `dotenv` command line tools to import the environment on each run (using `dotenv` lets you quickly switch different `.env` files in and out, which can be useful for testing, debugging, etc).
The `.env` file is used when running things locally to store environment variables that configure the apps mentioned above. Docker Compose will read this automatically, but when running the bulk data service app or `yoyo` directly, you need to get these variables into the shell environment: you can either source this file to get the environment variables into your current terminal context, or you can use one of the various `dotenv` command line tools to import the environment on each run (using `dotenv` lets you quickly switch different `.env` files in and out, which can be useful for testing, debugging, etc).

### Running after first-time setup

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "bulk-data-service"
version = "0.1.6"
version = "0.1.7"
requires-python = ">= 3.12"
readme = "README.md"
dependencies = [
Expand Down
1 change: 1 addition & 0 deletions src/bulk_data_service/zipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def zipper_run(context: dict, datasets_in_working_dir: dict[uuid.UUID, dict], da

run_end = datetime.datetime.now(datetime.UTC)
context["logger"].info("Zipper run finished in {}.".format(run_end - run_start))
context["prom_metrics"]["zipper_run_duration"].set((run_end - run_start).seconds)


def setup_working_dir_with_downloaded_datasets(
Expand Down
4 changes: 4 additions & 0 deletions src/utilities/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def get_metrics_definitions(context: dict) -> list:
"checker_run_duration",
"The time taken by the last run of the checker (seconds)",
),
(
"zipper_run_duration",
"The time taken by the last run of the zipper (seconds)",
),
(
"number_crashes",
"The number of crashes since app restart",
Expand Down

0 comments on commit cffcf55

Please sign in to comment.