Using worst-case-scenario for calculating map time-to-import.

This commit is contained in:
Roland 2022-11-05 13:28:40 -06:00
parent 6c2a5d723e
commit 66336e7ca5
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 7 additions and 6 deletions

View file

@ -6,7 +6,8 @@ from wrolpi import dates
from wrolpi.common import Base, ModelHelper
from wrolpi.media_path import MediaPathType
RPI4_PBF_BYTES_PER_SECOND = 7573
# Bps calculated using many tests on a well-cooled RPi4.
RPI4_PBF_BYTES_PER_SECOND = 3943
def seconds_to_import(path: Path, size: int) -> int:

View file

@ -8,11 +8,11 @@ from modules.map import models
@pytest.mark.parametrize('path,size,expected', [
('file.osm.pbf', 0, 0),
('file.osm.pbf', -1, 0),
('file.osm.pbf', 17737381, 2342),
('file.osm.pbf', 63434267, 8376),
('file.osm.pbf', 87745484, 11586),
('file.osm.pbf', 136372996, 18007),
('file.osm.pbf', 116318111, 15359),
('file.osm.pbf', 17737381, 4498),
('file.osm.pbf', 63434267, 16087),
('file.osm.pbf', 87745484, 22253),
('file.osm.pbf', 136372996, 34586),
('file.osm.pbf', 116318111, 29499),
])
def test_seconds_to_import_rpi4(path, size, expected):
assert models.seconds_to_import(Path(path), size) == expected