Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Issue 469983002: Compress alerts with zlib level 1 to fit in sheriff-o-matic's memcache. (Closed)

Created:
6 years, 4 months ago by dominicc (has gone to gerrit)
Modified:
6 years, 4 months ago
Reviewers:
ojan, eseidel
CC:
ojan, blink-reviews, dsinclair, eseidel, jochen (gone - plz use gerrit), leviw_travelin_and_unemployed, michaelpg, szager1, teravest
Project:
blink
Visibility:
Public.

Description

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 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -4 lines) Patch
M Tools/GardeningServer/alerts.py View 3 chunks +9 lines, -4 lines 0 comments Download
M Tools/GardeningServer/alerts_test.py View 1 2 chunks +68 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
dominicc (has gone to gerrit)
PTAL
6 years, 4 months ago (2014-08-14 00:02:33 UTC) #1
eseidel
lgtm Ideally we'd test.
6 years, 4 months ago (2014-08-14 00:06:48 UTC) #2
ojan
Yay! lgtm! https://codereview.chromium.org/469983002/diff/1/Tools/GardeningServer/alerts.py File Tools/GardeningServer/alerts.py (right): https://codereview.chromium.org/469983002/diff/1/Tools/GardeningServer/alerts.py#newcode46 Tools/GardeningServer/alerts.py:46: compressed = zlib.compress(uncompressed, compression_level) Nit: can you ...
6 years, 4 months ago (2014-08-14 01:03:51 UTC) #3
dominicc (has gone to gerrit)
Added a test. On 2014/08/14 01:03:51, ojan-only-code-yellow-reviews wrote: > Yay! lgtm! > > https://codereview.chromium.org/469983002/diff/1/Tools/GardeningServer/alerts.py > ...
6 years, 4 months ago (2014-08-14 02:10:16 UTC) #4
eseidel
Woh. That's crazy. you went well above and beyond. lgtm!
6 years, 4 months ago (2014-08-14 02:37:54 UTC) #5
ojan
The CQ bit was checked by ojan@chromium.org
6 years, 4 months ago (2014-08-14 02:40:40 UTC) #6
ojan
lgtm
6 years, 4 months ago (2014-08-14 02:40:40 UTC) #7
dominicc (has gone to gerrit)
Committed patchset #2 manually as 180222 (presubmit successful).
6 years, 4 months ago (2014-08-14 02:40:50 UTC) #8
dominicc (has gone to gerrit)
6 years, 4 months ago (2014-08-14 02:44:01 UTC) #9
Message was sent while issue was closed.
Thanks eseidel and ojan-only-code-yellow-reviews for reviews.

I dcommitted this because check-webkit-style does not understand that
AlertsHandler(webapp2.RequestHandler) inherits a member called 'response'... I
assume the Blink presubmit bot will squawk at that.

Powered by Google App Engine
This is Rietveld 408576698