From a91c4b8819e96a2760481166fe46be8d3f72effe Mon Sep 17 00:00:00 2001 From: Erik van Oosten Date: Wed, 5 Feb 2025 12:55:19 +0100 Subject: [PATCH] Keep flame graphs for 6 months Now that we're only running flame graphs on releases, we can keep them for much longer. --- scripts/prune-flame-graph.sc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/prune-flame-graph.sc b/scripts/prune-flame-graph.sc index 8ec4eba77..43c59500a 100755 --- a/scripts/prune-flame-graph.sc +++ b/scripts/prune-flame-graph.sc @@ -16,13 +16,15 @@ val indexPath = flameDir / "index.html" val indexContent = os.read(indexPath) val liPattern: Regex = """^ *
  • (\d{4}-\d{2}-\d{2}).*href="([0-9a-f]+)".*$""".r -val oneMonthAgo = LocalDate.now.minusMonths(1) + +// Flame graphs from before this date are removed. +val flameGraphCutoffDate = LocalDate.now.minusMonths(6) val (newIndexContentBuilder, removeDirsBuilder) = indexContent .linesIterator .foldLeft((Seq.newBuilder[String], Seq.newBuilder[String])) { case ((out, removed), line) => line match { - case liPattern(date, dir) if (LocalDate.parse(date) < oneMonthAgo) => + case liPattern(date, dir) if (LocalDate.parse(date) < flameGraphCutoffDate) => (out, removed += dir) case _ => (out += line, removed)