Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mikeyhu/GitStats
base: d879195d80
...
head fork: mikeyhu/GitStats
compare: 6635e14264
Checking mergeability… Don't worry, you can still create the pull request.
  • 9 commits
  • 5 files changed
  • 0 commit comments
  • 2 contributors
Commits on Oct 31, 2012
Casper devboxmatsumoto.springer-sbm.com Added sort order 'decending' to allow ordering of results cb7bd60
Casper devboxmatsumoto.springer-sbm.com Hacky generate HTML graph, should be tested properly! f272d28
Commits on Nov 01, 2012
Casper devboxmatsumoto.springer-sbm.com Added proper test for JSONWriter and for ordering 9abe5b2
Casper devboxmatsumoto.springer-sbm.com Added output option to yaml 00ea216
Casper devboxmatsumoto.springer-sbm.com Added initial case to choose output based on config and tidied up CSV…
…Writer
7213cf4
Casper devboxmatsumoto.springer-sbm.com JSONWriter can now output either a json object or a json array 37b1b93
Commits on Feb 21, 2013
Casper devboxmatsumoto.springer-sbm.com Added multigraph.rb to generate multiple graphs aad5206
Michael Hughes Example graph output 48d487f
Michael Hughes Merge branch 'master' of github.com:mikeyhu/GitStats
Conflicts:
	jsonwriter.rb
	template/googlegraph.html
6635e14
View
300 examples/tests-over-time.html
@@ -0,0 +1,300 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <title>
+ Google Visualization API Sample
+ </title>
+ <script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+ google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ <script type="text/javascript">
+ function drawVisualization() {
+ // Some raw data (not necessarily accurate)
+ var data = google.visualization.arrayToDataTable([["date","unit-tests","integration-tests","functional-tests","system-tests"],
+["2011-06-06",0,0,0,0],
+["2011-06-07",4,0,5,0],
+["2011-06-08",4,0,5,0],
+["2011-06-09",5,0,4,0],
+["2011-06-10",4,0,5,0],
+["2011-06-13",9,0,15,0],
+["2011-06-14",9,0,17,0],
+["2011-06-15",10,0,17,0],
+["2011-06-16",13,0,20,0],
+["2011-06-17",18,0,22,0],
+["2011-06-18",9,0,15,0],
+["2011-06-19",9,0,15,0],
+["2011-06-20",31,0,26,0],
+["2011-06-21",9,0,15,0],
+["2011-06-22",36,0,26,0],
+["2011-06-23",33,0,29,0],
+["2011-06-24",33,0,32,0],
+["2011-06-25",33,0,32,0],
+["2011-06-26",33,0,32,0],
+["2011-06-27",35,33,20,0],
+["2011-06-28",35,40,20,0],
+["2011-06-29",41,40,22,0],
+["2011-07-01",39,40,23,0],
+["2011-07-04",40,42,30,0],
+["2011-07-05",40,42,30,0],
+["2011-07-06",46,43,31,0],
+["2011-07-07",52,44,36,0],
+["2011-07-08",55,44,44,0],
+["2011-07-11",55,48,48,0],
+["2011-07-12",58,48,51,0],
+["2011-07-13",68,48,51,0],
+["2011-07-14",75,50,51,0],
+["2011-07-15",83,53,57,0],
+["2011-07-18",88,53,62,0],
+["2011-07-19",99,54,70,0],
+["2011-07-20",115,56,75,0],
+["2011-07-21",118,56,76,0],
+["2011-07-22",145,60,87,0],
+["2011-07-25",151,63,87,0],
+["2011-07-26",154,63,88,0],
+["2011-07-27",160,70,90,0],
+["2011-07-28",172,73,96,0],
+["2011-07-29",172,73,97,0],
+["2011-08-01",169,77,104,0],
+["2011-08-02",170,77,97,0],
+["2011-08-03",169,79,99,0],
+["2011-08-04",171,80,100,0],
+["2011-08-05",171,80,101,0],
+["2011-08-08",192,84,113,0],
+["2011-08-18",194,83,120,0],
+["2011-08-19",207,84,124,1],
+["2011-08-20",207,84,124,1],
+["2011-08-22",208,85,127,1],
+["2011-08-23",209,88,129,1],
+["2011-08-24",233,90,142,1],
+["2011-08-30",236,93,147,1],
+["2011-08-31",238,92,151,1],
+["2011-09-01",239,94,153,1],
+["2011-09-02",242,100,159,1],
+["2011-09-05",242,101,161,1],
+["2011-09-06",248,104,163,1],
+["2011-09-07",256,107,167,1],
+["2011-09-08",256,107,167,2],
+["2011-09-09",255,107,167,1],
+["2011-09-12",261,107,171,1],
+["2011-09-13",264,108,175,1],
+["2011-09-14",265,111,177,1],
+["2011-09-15",269,111,178,1],
+["2011-09-16",271,111,183,1],
+["2011-09-19",271,111,183,1],
+["2011-09-20",277,112,185,1],
+["2011-09-21",277,114,189,1],
+["2011-09-22",282,114,190,1],
+["2011-09-23",285,120,194,1],
+["2011-09-25",285,120,194,1],
+["2011-09-26",295,125,209,1],
+["2011-09-27",295,125,209,1],
+["2011-09-28",294,125,209,1],
+["2011-09-29",295,126,211,1],
+["2011-09-30",295,128,214,1],
+["2011-10-03",295,128,216,1],
+["2011-10-04",300,134,225,1],
+["2011-10-05",300,134,225,1],
+["2011-10-06",306,133,228,1],
+["2011-10-07",308,133,228,1],
+["2011-10-10",311,136,234,4],
+["2011-10-11",308,136,239,4],
+["2011-10-12",312,138,241,5],
+["2011-10-13",317,141,250,5],
+["2011-10-14",318,143,251,5],
+["2011-10-15",326,146,252,5],
+["2011-10-16",326,146,252,5],
+["2011-10-18",328,146,253,5],
+["2011-10-19",343,148,259,5],
+["2011-10-20",343,148,259,5],
+["2011-10-21",350,148,267,5],
+["2011-10-24",348,148,270,5],
+["2011-10-25",352,150,283,5],
+["2011-10-26",351,150,289,5],
+["2011-10-27",354,156,291,5],
+["2011-10-28",357,156,293,5],
+["2011-10-30",367,159,294,7],
+["2011-10-31",376,159,295,7],
+["2011-11-01",385,163,297,8],
+["2011-11-02",391,163,300,8],
+["2011-11-03",396,163,302,8],
+["2011-11-04",396,164,304,8],
+["2011-11-06",508,181,413,12],
+["2011-12-18",508,181,413,12],
+["2011-12-23",508,181,413,11],
+["2011-12-25",508,181,413,11],
+["2011-12-28",508,181,413,10],
+["2011-12-29",508,181,413,10],
+["2011-12-30",508,181,413,10],
+["2012-01-02",508,181,413,10],
+["2012-01-03",508,183,417,10],
+["2012-01-05",508,183,417,10],
+["2012-01-06",508,183,417,10],
+["2012-01-09",511,183,417,10],
+["2012-01-11",511,183,417,10],
+["2012-01-12",511,185,415,10],
+["2012-01-13",511,185,414,10],
+["2012-01-16",518,188,416,10],
+["2012-01-17",526,188,419,10],
+["2012-01-18",537,191,420,11],
+["2012-01-19",538,192,433,10],
+["2012-01-20",538,192,433,10],
+["2012-01-23",539,207,433,10],
+["2012-01-24",548,208,440,10],
+["2012-01-25",548,209,444,10],
+["2012-01-26",551,206,446,10],
+["2012-01-27",552,211,449,10],
+["2012-01-30",553,214,452,10],
+["2012-01-31",558,219,461,10],
+["2012-02-01",561,219,460,10],
+["2012-02-02",565,219,458,10],
+["2012-02-03",580,219,457,11],
+["2012-02-06",577,226,464,11],
+["2012-02-07",578,229,469,11],
+["2012-02-08",580,229,470,11],
+["2012-02-09",564,241,474,11],
+["2012-02-10",564,240,472,11],
+["2012-02-12",564,240,472,11],
+["2012-02-13",564,242,473,11],
+["2012-02-14",568,238,469,11],
+["2012-02-15",568,238,470,11],
+["2012-02-16",570,241,474,10],
+["2012-02-17",570,241,474,10],
+["2012-02-20",572,235,478,10],
+["2012-02-21",572,235,478,10],
+["2012-02-22",560,249,482,11],
+["2012-02-24",560,250,485,11],
+["2012-02-27",559,250,485,11],
+["2012-02-28",575,247,490,12],
+["2012-02-29",586,255,493,14],
+["2012-03-05",583,265,496,14],
+["2012-03-06",583,265,496,14],
+["2012-03-07",589,265,502,15],
+["2012-03-08",589,265,503,15],
+["2012-03-09",591,265,501,15],
+["2012-03-12",593,266,506,15],
+["2012-03-13",598,268,516,19],
+["2012-03-14",598,268,516,19],
+["2012-03-15",606,305,520,21],
+["2012-03-16",612,308,524,21],
+["2012-03-19",635,315,539,22],
+["2012-03-20",640,317,541,24],
+["2012-03-23",641,317,541,24],
+["2012-03-26",641,317,542,24],
+["2012-03-27",648,318,544,24],
+["2012-03-28",652,318,546,25],
+["2012-03-29",656,319,546,25],
+["2012-03-30",660,319,546,25],
+["2012-04-03",660,319,546,25],
+["2012-04-04",664,319,546,25],
+["2012-04-05",665,319,546,25],
+["2012-04-08",665,319,546,25],
+["2012-04-10",665,319,546,24],
+["2012-04-11",676,319,548,24],
+["2012-04-12",692,322,555,26],
+["2012-04-13",692,321,555,26],
+["2012-04-16",692,322,555,26],
+["2012-04-18",694,322,555,26],
+["2012-04-19",694,323,555,26],
+["2012-04-20",696,323,563,26],
+["2012-04-23",699,323,564,26],
+["2012-04-24",699,323,569,26],
+["2012-04-25",702,325,568,27],
+["2012-04-27",706,325,567,27],
+["2012-04-30",703,325,567,28],
+["2012-05-01",706,325,570,28],
+["2012-05-02",728,328,576,28],
+["2012-05-03",728,328,577,28],
+["2012-05-04",734,328,579,28],
+["2012-05-08",735,328,581,28],
+["2012-05-09",735,328,586,28],
+["2012-05-10",735,328,597,27],
+["2012-05-11",743,328,599,28],
+["2012-05-14",744,328,597,28],
+["2012-05-15",744,328,598,28],
+["2012-05-16",746,328,598,28],
+["2012-05-17",748,336,605,28],
+["2012-05-22",746,336,606,28],
+["2012-05-23",746,336,609,28],
+["2012-05-24",747,337,609,28],
+["2012-05-25",747,342,609,28],
+["2012-05-28",751,343,611,28],
+["2012-05-30",751,344,609,29],
+["2012-05-31",753,344,609,29],
+["2012-06-01",753,344,609,31],
+["2012-06-06",752,345,609,31],
+["2012-06-07",759,346,608,31],
+["2012-06-08",759,349,609,31],
+["2012-06-11",763,352,610,31],
+["2012-06-13",767,355,618,31],
+["2012-06-14",769,355,621,31],
+["2012-06-15",769,358,626,31],
+["2012-06-18",771,358,629,31],
+["2012-06-19",771,358,632,31],
+["2012-06-20",771,360,636,31],
+["2012-06-21",772,359,638,31],
+["2012-06-22",778,361,640,31],
+["2012-06-25",783,363,640,32],
+["2012-06-26",784,361,642,33],
+["2012-06-27",784,363,651,33],
+["2012-06-28",784,364,651,33],
+["2012-06-29",784,364,653,33],
+["2012-07-02",783,364,656,33],
+["2012-07-03",783,364,659,33],
+["2012-07-04",784,363,663,34],
+["2012-07-05",788,365,661,33],
+["2012-07-06",801,368,708,45],
+["2012-08-10",802,370,716,45],
+["2012-08-13",803,371,716,45],
+["2012-08-14",806,375,718,45],
+["2012-08-15",806,375,719,46],
+["2012-08-16",806,370,718,46],
+["2012-08-17",806,370,719,46],
+["2012-08-20",807,370,721,46],
+["2012-08-21",808,370,721,46],
+["2012-08-22",811,370,723,46],
+["2012-08-23",808,370,724,46],
+["2012-08-24",808,370,723,46],
+["2012-08-28",840,373,749,42],
+["2012-09-10",840,373,750,42],
+["2012-09-11",849,375,763,46],
+["2012-09-12",851,375,763,46],
+["2012-09-13",851,376,763,46],
+["2012-09-17",851,376,763,46],
+["2012-09-18",845,386,767,53],
+["2012-09-26",846,386,769,51],
+["2012-09-27",847,386,774,53],
+["2012-09-28",853,392,785,53],
+["2012-10-09",854,393,786,53],
+["2012-10-10",855,393,786,53],
+["2012-10-11",855,393,786,53],
+["2012-10-12",856,393,785,53],
+["2012-10-15",858,393,779,53],
+["2012-10-17",860,395,774,52],
+["2012-10-19",860,395,774,52],
+["2012-10-22",860,395,774,52],
+["2012-10-23",859,395,779,52],
+["2012-10-24",859,395,779,52]]);
+
+ // Create and draw the visualization.
+ var ac = new google.visualization.AreaChart(document.getElementById('visualization'));
+ ac.draw(data, {
+ title : 'Different types of tests over time',
+ isStacked: true,
+ width: 800,
+ height: 600,
+ vAxis: {title: "Number of Tests"},
+ hAxis: {title: "Date"}
+ });
+ }
+
+
+ google.setOnLoadCallback(drawVisualization);
+ </script>
+ </head>
+ <body style="font-family: Arial;border: 0 none;">
+ <div id="visualization" style="width: 800px; height: 600px;"></div>
+ </body>
+</html>
+
View
6 jsonwriter.rb
@@ -9,11 +9,15 @@ def output_json(configuration,commits)
end
def output_array(configuration,commits)
+ generate_array(configuration,commits).to_json
+ end
+
+ def generate_array(configuration,commits)
title = ["date"] + configuration.collect.map{|key,command|key}
stats = [title]
commits.each { |commit| stats <<
(commit.select{|key,entry|key != :hash}.map{|key,entry|entry})
}
- stats.to_json
+ stats
end
end
View
29 multigraph.rb
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require './statcollector.rb'
+require './jsonwriter.rb'
+require './csvwriter.rb'
+require 'psych'
+require 'json'
+
+configurations = ARGV.map {|yamlFile|
+ yaml = Psych.load_file(yamlFile)
+ StatConfiguration.new(yaml)
+}
+
+graphs = configurations.map {|configuration|
+ collector = StatCollector.new(configuration)
+ statistics = collector.get_statistics
+ writer = JSONWriter.new()
+ {
+ :name => configuration.name,
+ :statistics => writer.generate_array(configuration,statistics)
+ }
+}
+
+data = "var graphs = #{graphs.to_json};"
+html = graphs.map {|graph| "<div id=\"#{graph[:name]}\" style=\"float:left\"></div>"}.join("\n")
+
+template = File.open("./template/multigraph.html").read
+puts template.sub("$$DATA$$",data).sub("$$HTML$$",html)
+
+
View
2  template/googlegraph.html
@@ -18,7 +18,7 @@
var ac = new google.visualization.AreaChart(document.getElementById('visualization'));
ac.draw(data, {
title : 'Different types of tests over time',
- isStacked: false,
+ isStacked: true,
width: 1000,
height: 800,
vAxis: {title: "Number of Tests"},
View
45 template/multigraph.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <title>
+ Google Visualization API Sample
+ </title>
+ <script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+ google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ <script type="text/javascript">
+ function drawVisualizations() {
+ for(var key in graphs) {
+ graph = graphs[key]
+ drawVisualization(graph.name, graph.statistics)
+ }
+ }
+
+ function drawVisualization(name,statistics) {
+
+ var data = google.visualization.arrayToDataTable(statistics);
+ var ac = new google.visualization.AreaChart(document.getElementById(name));
+ ac.draw(data, {
+ title : name,
+ isStacked: false,
+ width: 400,
+ height: 300,
+ vAxis: {title: "Number of Tests"},
+ hAxis: {title: "Date"}
+ });
+ }
+
+
+ $$DATA$$
+ google.setOnLoadCallback(drawVisualizations);
+ </script>
+ </head>
+ <body style="font-family: Arial;border: 0 none;">
+ <h1>Tests over time</h1>
+ $$HTML$$
+ </body>
+</html>
+
+

No commit comments for this range

Something went wrong with that request. Please try again.