Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/merge-auto-explain-logs')
-rwxr-xr-xscripts/merge-auto-explain-logs14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/merge-auto-explain-logs b/scripts/merge-auto-explain-logs
new file mode 100755
index 00000000000..0dff4fb33f8
--- /dev/null
+++ b/scripts/merge-auto-explain-logs
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require "set"
+require "json"
+
+fingerprints = Set.new
+
+ARGF.each_line do |line|
+ fingerprint = JSON.parse(line)['fingerprint']
+ $stdout.puts(line) && $stdout.flush if fingerprints.add?(fingerprint)
+end
+
+warn("auto_explain log contains #{fingerprints.size} entries")