Skip to content

Instantly share code, notes, and snippets.

@ajstarks
Last active September 9, 2018 17:13
Show Gist options
  • Save ajstarks/2177ffdcbb1259002b353c5e0541665f to your computer and use it in GitHub Desktop.
Save ajstarks/2177ffdcbb1259002b353c5e0541665f to your computer and use it in GitHub Desktop.
gopherstats charting
#!/bin/bash
. $HOME/Library/deckfuncs.sh
gopherstats -mode github-issue-close > gic
gopherstats -mode gerrit-cls > gerrit
awk '{print $1 "\t" substr($14, 2)}' gic > goog-people.d
awk '{print $1 "\t" substr($16, 2)}' gic > ext-people.d
awk '{print $1 "\t" substr($8, 1, length($8)-1)}' gic > goog.d
awk '{print $1 "\t" substr($10, 1, length($10)-2)}' gic > ext.d
awk '{print $1 "\t" (substr($8, 1, length($8)-1)/$4)*100}' gic > googpct.d
awk '{print $1 "\t" (substr($10, 1, length($10)-2)/$4)*100}' gic > extpct.d
awk '$3 == "commits" { print substr($1,1,length($1)-1) "\t" ($5/$2)*100 }' gerrit > goog-commit.d
awk '$3 == "commits" { print substr($1,1,length($1)-1) "\t" ($7/$2)*100 }' gerrit > ext-commit.d
awk '$3 == "unique" { print substr($1,1,length($1)-1) "\t" ($6/$2)*100 }' gerrit > goog-uniq.d
awk '$3 == "unique" { print substr($1,1,length($1)-1) "\t" ($8/$2)*100 }' gerrit > ext-uniq.d
extcolor="orange"
googcolor="blue"
function pctchart {
pctopt="-fulldeck=f -val=f -min=0 -max=100 -yrange=0,100,50"
slide begin
dchart -bar=f -line -scatter -color="$extcolor" -chartitle "$1" -barwidth=1 -hline 50,parity $pctopt -grid -yaxis $3
dchart -bar=f -scatter -color="$googcolor" -vcolor=black -line $pctopt $2
legend "Google" 10 20 1 sans "$googcolor"
legend "External" 20 20 1 sans "$extcolor"
slide end
}
function counts {
opts="-fulldeck=f -bar=f -val=f -line -scatter -min=$4 -max=$5"
slide begin
dchart $opts -yaxis -yrange="0,$5,$6" -grid -color=$googcolor -vcolor=black -chartitle "$1" $2
dchart $opts -xlabel=0 -color=$extcolor $3
legend "Google" 10 20 1 sans $googcolor
legend "External" 20 20 1 sans $extcolor
slide end
}
deck begin
counts "Google/External Issue Closes (quarterly)" goog.d ext.d 0 1200 200
counts "Google/External Unique Committers (quarterly)" goog-people.d ext-people.d 0 60 10
pctchart "% Google/External Issue Closes (quarterly)" googpct.d extpct.d
pctchart "% Google/External External Commits (quarterly)" goog-commit.d ext-commit.d
pctchart "% Google/External Unique Users (quarterly)" goog-uniq.d ext-uniq.d
deck end
@ajstarks
Copy link
Author

ajstarks commented Sep 9, 2018

dchart script to plot data from the gopherstats program. These charts are created:

  1. Google/External Issue Closes (quarterly)
  2. Google/External Unique Committers (quarterly)
  3. % Google/External Issue Closes (quarterly)
  4. % Google/External External Commits (quarterly)
  5. % Google/External Unique Users (quarterly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment