Skip to content

Commit

Permalink
Merge pull request #948 from girder/rest-rate-limiting
Browse files Browse the repository at this point in the history
Adjust logging rate for region endpoints
  • Loading branch information
manthey authored Aug 30, 2022
2 parents f37f32d + 7b170b9 commit 7515336
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions girder/girder_large_image/rest/tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 7515336

Please sign in to comment.