public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Manuel Rüger" <mrueg@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/ruby-scripts:master commit in: ruby-stats/stable/
Date: Sat, 27 Dec 2014 19:52:33 +0000 (UTC)	[thread overview]
Message-ID: <1419709944.2f46c6e92ad914ef3e07ab92eba98fc9344b8ae2.mrueg@gentoo> (raw)

commit:     2f46c6e92ad914ef3e07ab92eba98fc9344b8ae2
Author:     Manuel Rüger <manuel <AT> rueg <DOT> eu>
AuthorDate: Sat Dec 27 19:52:24 2014 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Sat Dec 27 19:52:24 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/ruby-scripts.git;a=commit;h=2f46c6e9

Add script for stable statistics.

---
 ruby-stats/stable/plot                 | 26 +++++++++++++++
 ruby-stats/stable/ruby_stable_stats.py | 59 ++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)

diff --git a/ruby-stats/stable/plot b/ruby-stats/stable/plot
new file mode 100644
index 0000000..b160d36
--- /dev/null
+++ b/ruby-stats/stable/plot
@@ -0,0 +1,26 @@
+set terminal svg size 1024,768 enhanced
+set termoption dashed
+
+set output "targets.svg"
+
+set object 1 rect from screen 0, 0, 0 to screen 1, 1, 0 behind
+set object 1 rect fc  rgb "white"  fillstyle solid 1.0
+
+set title "RUBY\\_TARGETS support in Gentoo\n{/*0.7 based on latest stable amd64 version per slot \\@ `cat $(portageq portdir 2>/dev/null)/metadata/timestamp`}"
+set ylabel "Packages"
+set xlabel "Time"
+set xdata time
+set timefmt "%Y-%m-%d"
+set format x "%b %d"
+
+set key top left 
+
+plot "data.txt" using 1:3 with lines lt 2 title "total", \
+     "data.txt" using 1:4 with lines lt 1 lc 1 title "ruby18", \
+     "data.txt" using 1:5 with lines lt 1 lc 2 title "ruby19", \
+     "data.txt" using 1:6 with lines lt 1 lc 3 title "ruby20", \
+     "data.txt" using 1:10 with lines lt 1 lc 7 title "ruby21", \
+     "data.txt" using 1:11 with lines lt 1 lc 8 title "ruby22", \
+     "data.txt" using 1:7 with lines lt 1 lc 4 title "jruby", \
+     "data.txt" using 1:8 with lines lt 1 lc 5 title "ree18", \
+     "data.txt" using 1:9 with lines lt 1 lc 6 title "rbx"

diff --git a/ruby-stats/stable/ruby_stable_stats.py b/ruby-stats/stable/ruby_stable_stats.py
new file mode 100755
index 0000000..77cc9ae
--- /dev/null
+++ b/ruby-stats/stable/ruby_stable_stats.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+# date                ruby.eclass     ruby-ng.eclass  ruby18  ruby19  ruby20 jruby ree18 rbx ruby21 ruby22
+# 2010-01-20    181             143             141     68      51
+# 2010-01-21    180             144             142     68      52
+#
+date_fmt = "%Y-%m-%d"
+bins = ('ruby', 'ruby-ng', 'ruby_targets_ruby18', 'ruby_targets_ruby19', 'ruby_targets_ruby20', 'ruby_targets_jruby', 'ruby_targets_ree18', 'ruby_targets_rbx', 'ruby_targets_ruby21', 'ruby_targets_ruby22')
+
+import sys
+import time
+import os
+import portage
+
+def main():
+	stats = {}
+	for k in bins:
+		stats[k] = set()
+
+	portdb = portage.portdb
+	portdb.porttrees = [portdb.porttree_root] # exclude overlays
+	for cp in portdb.cp_all():
+		slot_dict = {}
+		for cpv in portdb.cp_list(cp):
+			slot, iuse, inherited, keywords = portdb.aux_get(cpv, ['SLOT', 'IUSE', 'INHERITED', 'KEYWORDS'])
+			if  "amd64" in keywords and not "~amd64" in keywords:
+				slot_dict.setdefault(slot, {})[cpv] = (iuse, inherited)
+		for slot, cpv_dict in slot_dict.items():
+			cpv = portage.best(list(cpv_dict))
+			if cpv:
+				iuse, inherited = cpv_dict[cpv]
+				iuse = set(iuse.split())
+				inherited = set(inherited.split())
+				if 'ruby' in inherited:
+					stats['ruby'].add(cpv)
+				if 'ruby-ng' in inherited:
+					stats['ruby-ng'].add(cpv)
+					if 'ruby_targets_ruby18' in iuse:
+						stats['ruby_targets_ruby18'].add(cpv)
+					if 'ruby_targets_ruby19' in iuse:
+						stats['ruby_targets_ruby19'].add(cpv)
+					if 'ruby_targets_ruby20' in iuse:
+						stats['ruby_targets_ruby20'].add(cpv)
+					if 'ruby_targets_ruby21' in iuse:
+						stats['ruby_targets_ruby21'].add(cpv)
+					if 'ruby_targets_ruby22' in iuse:
+						stats['ruby_targets_ruby22'].add(cpv)
+					if 'ruby_targets_jruby' in iuse:
+						stats['ruby_targets_jruby'].add(cpv)
+					if 'ruby_targets_ree18' in iuse:
+						stats['ruby_targets_ree18'].add(cpv)
+					if 'ruby_targets_rbx' in iuse:
+						stats['ruby_targets_rbx'].add(cpv)
+
+	date_stamp = time.strftime(date_fmt, time.gmtime())
+	counts = [str(len(stats[x])) for x in bins]
+	sys.stdout.write("%s\t%s\n" % (date_stamp, "\t".join(counts)))
+
+if __name__ == '__main__':
+	main()


                 reply	other threads:[~2014-12-27 19:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419709944.2f46c6e92ad914ef3e07ab92eba98fc9344b8ae2.mrueg@gentoo \
    --to=mrueg@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox