Module: GitHub::Client::Stats
- Included in:
- GitHub::Client
- Defined in:
- lib/github_api_v3/client/stats.rb
Overview
Methods for the Repo Statistics API.
A notice about caching from GitHub’s API: Computing repository statistics is an expensive operation, so we try to return cached data whenever possible. If the data hasn’t been cached when you query a repository’s statistics, you’ll receive a 202 response; a background job is also fired to start compiling these statistics. Give the job a few moments to complete, and then submit the request again. If the job has completed, that request will receive a 200 response with the statistics in the response body. Repository statistics are cached by the SHA of the repository’s default branch, which is usually master; pushing to the default branch resets the statistics cache.
Instance Method Summary collapse
-
#code_frequency(owner, repo) ⇒ Array
Get the number of additions and deletions per week.
-
#commit_activity(owner, repo) ⇒ Array
Get the last year of commit activity data.
-
#contributors_list(owner, repo) ⇒ Array
Get contributors list with additions, deletions, and commit counts.
-
#participation(owner, repo) ⇒ Array
Get the weekly commit count for the repo owner and everyone else.
-
#punch_card(owner, repo) ⇒ Array
Get the number of commits per hour in each day.
Instance Method Details
#code_frequency(owner, repo) ⇒ Array
Get the number of additions and deletions per week.
47 48 49 |
# File 'lib/github_api_v3/client/stats.rb', line 47 def code_frequency(owner, repo) get "/repos/#{owner}/#{repo}/stats/code_frequency" end |
#commit_activity(owner, repo) ⇒ Array
Get the last year of commit activity data.
37 38 39 |
# File 'lib/github_api_v3/client/stats.rb', line 37 def commit_activity(owner, repo) get "/repos/#{owner}/#{repo}/stats/commit_activity" end |
#contributors_list(owner, repo) ⇒ Array
Get contributors list with additions, deletions, and commit counts.
27 28 29 |
# File 'lib/github_api_v3/client/stats.rb', line 27 def contributors_list(owner, repo) get "/repos/#{owner}/#{repo}/stats/contributors" end |
#participation(owner, repo) ⇒ Array
Get the weekly commit count for the repo owner and everyone else.
57 58 59 |
# File 'lib/github_api_v3/client/stats.rb', line 57 def participation(owner, repo) get "/repos/#{owner}/#{repo}/stats/participation" end |
#punch_card(owner, repo) ⇒ Array
Get the number of commits per hour in each day.
67 68 69 |
# File 'lib/github_api_v3/client/stats.rb', line 67 def punch_card(owner, repo) get "/repos/#{owner}/#{repo}/stats/punch_card" end |