diff options
author | Pascal Terjan <pterjan@mageia.org> | 2025-06-29 18:13:53 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2025-06-29 18:13:53 +0000 |
commit | c9a64b98257c0ac8f7303eab5fc504277db29a66 (patch) | |
tree | c37030576d8ea02b7df87ab9a43bd72eaf3f8540 | |
parent | aaf8243e08ed4ddc44f09e3ac18a055a62dde098 (diff) | |
download | release-master.tar release-master.tar.gz release-master.tar.bz2 release-master.tar.xz release-master.zip |
-rw-r--r-- | collecstats.rb | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/collecstats.rb b/collecstats.rb new file mode 100644 index 0000000..efe6055 --- /dev/null +++ b/collecstats.rb @@ -0,0 +1,53 @@ +require 'date' + +packages = {} + +def file_time(file_name) + File::Stat.new(file_name).mtime +end + +Dir.glob("/var/lib/schedbot/uploads/todo/cauldron/core/release/*umeabo*.info").each{|f| + # f = "/var/lib/schedbot/uploads/todo/cauldron/core/release/20250628173238.umeabot.duvel.498607_@2220249:rust-pathfinder_simd-0.5.2-0.2.mga10.src.rpm.info" + prefix = f.sub(/.*\/([^\/]*\.umeabot[^_]*)_.*/, "\\1") + path = f.sub(/(.*)\/[^\/]*\.umeabot.*/, "\\1") + srpm = f.sub(/.*:(.*)\.info/, "\\1") + + p = {} + done_path = path.sub(/\/todo\//, "/done/") + p['submit_time'] = DateTime.strptime(f.sub(/.*\/([^\/]*)\.umeabot.*/, "\\1"), "%Y%m%d%H%M%S").to_time + upload_file = "#{done_path}/#{prefix}.upload" + if File.exists?(upload_file) then + p['upload_time'] = file_time(upload_file) + else + next + end + noarch = File.exists?("#{done_path}/#{prefix}_noarch.done") + Dir.glob("#{done_path}/#{prefix}/*/build.*.log").each{|l| + # rpm_qa.i686.0.20250628173325.log + s = File.basename(l).split(".") + if noarch then + arch = "noarch" + else + arch = s[1] + end + start_time = DateTime.strptime(s[3], "%Y%m%d%H%M%S").to_time + end_time = file_time(l) + p["builds"] ||= {} + p["builds"][arch] = { + 'build_start' => start_time, + 'build_end' => end_time, + 'build_secs' => (end_time - start_time).to_i, + } + } + packages[srpm] = p +} + +puts "package,arch,submit_time,upload_time,build_start_time,build_end_time,build_secs" +packages.keys.sort.each{|pname| + pkg = packages[pname] + pkg["builds"].keys.sort.each{|b| + t = pkg["builds"][b] + puts "#{pname},#{b},#{pkg["submit_time"]},#{pkg["upload_time"]},#{t["build_start"]},#{t["build_end"]},#{t["build_secs"]}" + } +} + |