Package org.kohsuke.github
Class GHRepositoryStatistics
- java.lang.Object
-
- org.kohsuke.github.GHRepositoryStatistics
-
public class GHRepositoryStatistics extends Object
Statistics for a GitHub repository.- Author:
- Martin van Zijl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GHRepositoryStatistics.CodeFrequency
The type CodeFrequency.static class
GHRepositoryStatistics.CommitActivity
The type CommitActivity.static class
GHRepositoryStatistics.ContributorStats
The type ContributorStats.static class
GHRepositoryStatistics.Participation
The type Participation.static class
GHRepositoryStatistics.PunchCardItem
The type PunchCardItem.
-
Constructor Summary
Constructors Constructor Description GHRepositoryStatistics(GHRepository repo)
Instantiates a new Gh repository statistics.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<GHRepositoryStatistics.CodeFrequency>
getCodeFrequency()
Get the number of additions and deletions per week.PagedIterable<GHRepositoryStatistics.CommitActivity>
getCommitActivity()
Get the last year of commit activity data.PagedIterable<GHRepositoryStatistics.ContributorStats>
getContributorStats()
Get contributors list with additions, deletions, and commit count.PagedIterable<GHRepositoryStatistics.ContributorStats>
getContributorStats(boolean waitTillReady)
Deprecated.GHRepositoryStatistics.Participation
getParticipation()
Get the weekly commit count for the repository owner and everyone else.List<GHRepositoryStatistics.PunchCardItem>
getPunchCard()
Get the number of commits per hour in each day.
-
-
-
Constructor Detail
-
GHRepositoryStatistics
public GHRepositoryStatistics(GHRepository repo)
Instantiates a new Gh repository statistics.- Parameters:
repo
- the repo
-
-
Method Detail
-
getContributorStats
public PagedIterable<GHRepositoryStatistics.ContributorStats> getContributorStats() throws IOException, InterruptedException
Get contributors list with additions, deletions, and commit count. See https://developer.github.com/v3/repos/statistics/#get-contributors-list-with-additions-deletions-and-commit-counts- Returns:
- the contributor stats
- Throws:
IOException
- the io exceptionInterruptedException
- the interrupted exception
-
getContributorStats
@BetaApi @Deprecated public PagedIterable<GHRepositoryStatistics.ContributorStats> getContributorStats(boolean waitTillReady) throws IOException, InterruptedException
Deprecated.Gets contributor stats.- Parameters:
waitTillReady
- Whether to sleep the thread if necessary until the statistics are ready. This is true by default.- Returns:
- the contributor stats
- Throws:
IOException
- the io exceptionInterruptedException
- the interrupted exception
-
getCommitActivity
public PagedIterable<GHRepositoryStatistics.CommitActivity> getCommitActivity() throws IOException
Get the last year of commit activity data. See https://developer.github.com/v3/repos/statistics/#get-the-last-year-of-commit-activity-data- Returns:
- the commit activity
- Throws:
IOException
- the io exception
-
getCodeFrequency
public List<GHRepositoryStatistics.CodeFrequency> getCodeFrequency() throws IOException
Get the number of additions and deletions per week. See https://developer.github.com/v3/repos/statistics/#get-the-number-of-additions-and-deletions-per-week- Returns:
- the code frequency
- Throws:
IOException
- the io exception
-
getParticipation
public GHRepositoryStatistics.Participation getParticipation() throws IOException
Get the weekly commit count for the repository owner and everyone else. See https://developer.github.com/v3/repos/statistics/#get-the-weekly-commit-count-for-the-repository-owner-and-everyone-else- Returns:
- the participation
- Throws:
IOException
- the io exception
-
getPunchCard
public List<GHRepositoryStatistics.PunchCardItem> getPunchCard() throws IOException
Get the number of commits per hour in each day. See https://developer.github.com/v3/repos/statistics/#get-the-number-of-commits-per-hour-in-each-day- Returns:
- the punch card
- Throws:
IOException
- the io exception
-
-