Skip to content

Commit

Permalink
calc time
Browse files Browse the repository at this point in the history
  • Loading branch information
brettedw committed Nov 5, 2024
1 parent d7ad1fb commit b677636
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/app/jobs/sfms_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ class SFMSCalcJob:
async def calculate_bui(self, start_time: datetime):
logger.info(f"Begin BUI raster calculations -- calculating {DAYS_TO_CALCULATE} days forward")

Check warning on line 23 in api/app/jobs/sfms_calculations.py

View check run for this annotation

Codecov / codecov/patch

api/app/jobs/sfms_calculations.py#L23

Added line #L23 was not covered by tests

start_exec = get_utc_now()

Check warning on line 25 in api/app/jobs/sfms_calculations.py

View check run for this annotation

Codecov / codecov/patch

api/app/jobs/sfms_calculations.py#L25

Added line #L25 was not covered by tests

bui_processor = BUIDateRangeProcessor(start_time, DAYS_TO_CALCULATE, RasterKeyAddresser())

Check warning on line 27 in api/app/jobs/sfms_calculations.py

View check run for this annotation

Codecov / codecov/patch

api/app/jobs/sfms_calculations.py#L27

Added line #L27 was not covered by tests

async with S3Client() as s3_client:
await bui_processor.process_bui(s3_client, multi_wps_dataset_context, multi_wps_dataset_context)

Check warning on line 30 in api/app/jobs/sfms_calculations.py

View check run for this annotation

Codecov / codecov/patch

api/app/jobs/sfms_calculations.py#L29-L30

Added lines #L29 - L30 were not covered by tests

# calculate the execution time.
execution_time = get_utc_now() - start_time
execution_time = get_utc_now() - start_exec
hours, remainder = divmod(execution_time.seconds, 3600)
minutes, seconds = divmod(remainder, 60)

Check warning on line 35 in api/app/jobs/sfms_calculations.py

View check run for this annotation

Codecov / codecov/patch

api/app/jobs/sfms_calculations.py#L33-L35

Added lines #L33 - L35 were not covered by tests

Expand Down

0 comments on commit b677636

Please sign in to comment.