Compress 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 Review URL: https://codereview.chromium.org/469983002 git-svn-id: svn://svn.chromium.org/blink/trunk@180222 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment