• Swapnil's avatar
    Log Upload Throttling on Chrome Process Restart · c39f3221
    Swapnil authored
    Currently the logs were being uploaded at each chrome process restart.
    Upload at most K logs in any X hours window. This prevents log uploading at start of each chrome process. Local state of chrome process is maintained across reboots. Maintained a List of uploads made in the previous X hour window.
    UpdateLocalStateForLogs() keeps the logs updated for previous X hour window and appends if any upload is made recently.
    
    The unit test makes K+3 uploads consecutively, and checks if delay of first K uploads is 0 and for the remaining uploads it is approximately X.
    Another unit test checks that immediate log upload is not throttled.
    Initial Commit
    
    Bug: 789481
    Change-Id: I16cadf69e68d8982b5b2384aebbeb6cdad892d2e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1876092
    Commit-Queue: Swapnil Gupta <swapnilgupta@google.com>
    Reviewed-by: default avatarSergey Poromov <poromov@chromium.org>
    Reviewed-by: default avatarIvan Šandrk <isandrk@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#713395}
    c39f3221
system_log_uploader.h 7.01 KB