DescriptionCompress alerts with zlib level 1 to fit in sheriff-o-matic's memcache.
When there were 2000 failures recently the resulting alerts JSON was
~2.5MB. This is too big to fit in memcache's 1MB limit [1].
However the data compresses readily (sizes in K; level 0 is the
uncompressed size):
>>> import zlib
>>> uncompressed = open('data.json', 'r').read()
>>> for level in range(0,10):
... compressed = zlib.compress(uncompressed, level)
... print level, len(compressed) / 1024.0
...
0 2525.62207031
1 129.721679688
2 121.662109375
3 120.194335938
4 117.762695312
5 111.912109375
6 105.26953125
7 104.64453125
8 101.791015625
9 101.745117188
[1] https://developers.google.com/appengine/docs/python/memcache/#Python_Limits
TEST=PYTHONPATH=/usr/local/google_appengine Tools/GardeningServer/tests.py
BUG=401358
R=eseidel@chromium.org, ojan@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180222
Patch Set 1 #
Total comments: 1
Patch Set 2 : Add a test for a large number of alerts. #
Messages
Total messages: 9 (0 generated)
|