From 7b170b96d25fd7793a541b35496251f5fa3fba07 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Tue, 30 Aug 2022 08:54:08 -0400 Subject: [PATCH] Adjust logging rate for region endpoints. --- CHANGELOG.md | 3 +++ girder/girder_large_image/rest/tiles.py | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f80d182e..faea2adee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ - Better ignore tiff directories that aren't part of the pyramid ([943](../../pull/943)) - Fix an issue with styling frames in ome tiffs ([945](../../pull/945)) +### Changes +- Adjusted rest request logging rates for region endpoint ([948](../../pull/948)) + ## 1.16.1 ### Improvements diff --git a/girder/girder_large_image/rest/tiles.py b/girder/girder_large_image/rest/tiles.py index b5b11f4be..a7a58ef86 100644 --- a/girder/girder_large_image/rest/tiles.py +++ b/girder/girder_large_image/rest/tiles.py @@ -165,12 +165,19 @@ def __init__(self, apiRoot): self.getDZITile) apiRoot.item.route('GET', (':itemId', 'tiles', 'internal_metadata'), self.getInternalMetadata) + # Logging rate limiters filter_logging.addLoggingFilter( 'GET (/[^/ ?#]+)*/item/[^/ ?#]+/tiles/zxy(/[^/ ?#]+){3}', - frequency=250) + frequency=250, duration=10) + filter_logging.addLoggingFilter( + 'GET (/[^/ ?#]+)*/item/[^/ ?#]+/tiles/fzxy(/[^/ ?#]+){3}', + frequency=250, duration=10) filter_logging.addLoggingFilter( 'GET (/[^/ ?#]+)*/item/[^/ ?#]+/tiles/dzi_files(/[^/ ?#]+){2}', - frequency=250) + frequency=250, duration=10) + filter_logging.addLoggingFilter( + 'GET (/[^/ ?#]+)*/item/[^/ ?#]+/tiles/region', + frequency=100, duration=10) # Cache the model singleton self.imageItemModel = ImageItem()