Skip to content

Commit 6ef7a80

Browse files
author
Justin Palmer
committed
add remaining stat response docs
1 parent 42af9be commit 6ef7a80

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
source "http://rubygems.org"
22

3+
ruby '1.9.3'
4+
35
gem 'builder'
46
gem 'coderay'
57
gem 'kramdown', '~> 0.13.2'

content/v3/repos/statistics.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ is a group of commits per day, starting on `Sunday`.
4848
### Response
4949

5050
<%= headers 200 %>
51+
<%= json(:repo_stats_code_frequency) %>
5152

5253
## Get the weekly commit count for the repo owner and others
5354

@@ -56,11 +57,21 @@ is a group of commits per day, starting on `Sunday`.
5657
### Response
5758

5859
<%= headers 200 %>
60+
<%= json(:repo_stats_participation) %>
5961

6062
## Get the number of commits per hour in day
6163

6264
GET /repos/:owner/:repo/stats/punch_card
6365

6466
### Response
6567

66-
<%= headers 200 %>
68+
Each array contains the day number, hour number and number of commits:
69+
70+
* `0-6` = Sunday - Saturday
71+
* `0-23` = Hour of day
72+
* Number of commits
73+
74+
For example, `[2, 14, 25]` would indicate that there were 25 total commits, during the 2:00pm hour on Tuesdays.
75+
76+
<%= headers 200 %>
77+
<%= json(:repo_stats_punch_card) %>

lib/resources.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,12 +1140,28 @@ def text_html(response, status, head = {})
11401140
]
11411141
}]
11421142

1143-
11441143
REPO_STATS_COMMIT_ACTIVITY = [{
11451144
:days => [0, 3, 26, 20, 39, 1, 0],
11461145
:total => 89,
11471146
:week => "2012-05-06"
11481147
}]
1148+
1149+
REPO_STATS_CODE_FREQUENCY = [[
1150+
1302998400,
1151+
1124,
1152+
-435
1153+
]]
1154+
1155+
REPO_STATS_PARTICIPATION = {
1156+
:all => [11,21,15,2,8,1,8,23,17,21,11,10,33,91,38,34,22,23,32,3,43,87,71,18,13,5,13,16,66,27,12,45,110,117,13,8,18,9,19,26,39,12,20,31,46,91,45,10,24,9,29,7],
1157+
:owner => [3,2,3,0,2,0,5,14,7,9,1,5,0,48,19,2,0,1,10,2,23,40,35,8,8,2,10,6,30,0,2,9,53,104,3,3,10,4,7,11,21,4,4,22,26,63,11,2,14,1,10,3]
1158+
}
1159+
1160+
REPO_STATS_PUNCH_CARD = [
1161+
[0,0,5],
1162+
[0,1,43],
1163+
[0,2,21]
1164+
]
11491165
end
11501166
end
11511167

0 commit comments

Comments
 (0)