wkeeling / ratelimitingfilter Goto Github PK
View Code? Open in Web Editor NEWA filter for the Python logging system that can rate-limit the throughput of messages
License: MIT License
A filter for the Python logging system that can rate-limit the throughput of messages
License: MIT License
TypeError: unsupported operand type(s) for +=: 'ConnectionError' and 'str'
This project used to use Travis for CI, but should now be converted to use GitHub actions for running tests and deployment to PyPI.
Hey,
I've build an RPM package out of this repository for Fedora.
It is currently available in Fedora 27, Fedora 28, and Rawhide.
You can install with:
dnf install python{2,3}-ratelimitingfilter
Hey,
When logging just an numeric value, and rate limiting kicks in, a TypeError
is raised, as the library tries to concatenate an int
and str
.
eg.
for x in range(100):
log.info(x)
File "/home/mnuttall/.pyenv/versions/3.6.5/lib/python3.6/logging/__init__.py", line 718, in filter
result = f.filter(record)
File "/home/mnuttall/.local/share/virtualenvs/catalog-ilphx365/lib/python3.6/site-packages/ratelimitingfilter/ratelimitingfilter.py", line 74, in filter
num=bucket.limited)
TypeError: unsupported operand type(s) for +=: 'int' and 'str'
Otherwise, thanks for the lib ๐
Hi,
Nice library! I'm looking a way to setup a throttling that passes a record only once. Is it possible with your filters?
By using getMessage()
, you are omitting any formatting parameter, this will cause an issue when the logger uses args
For example: logger.info("Example: %s", "text")
will be rendered twice while the second time it will be something similar to
"Example: text" % ("text",)
In order to fix this, you only need to set record.args
to an empty tuple
This looks like a useful library. Would you be willing to put it on pypi?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.