Keep Redis' production flamegraphs longer
Recently, there is a cronjob that records the CPU profiles via perf, generate a flamegraph, and uploads into a GCS bucket. This script capture one flamegraph hourly. It also deletes the old records after 30 days due to the size of the samples. However, in some investigations, we may need the flamegraphs in the past to compare the patterns. From a discussion with @cmiskell, we can alter the script to keep the flamegraphs longer:
- The above script generates a new gzip file from the corresponding svg file.
- When deleting the old records, the sample files and raw svg files over 30 days are removed; gzipped svg files over 1 year are removed.
The svg file is actually a text vector file. After gzip with -9 compression level, the archive file reduces by 85%. After 1 year, the total storage for the archived gzipped svg files cost 438MB to 876MB, seems reasonable.