This API is available to pull a variety of metrics back about your installation. Any admin user can access this API. Normal users will receive a 404 response if they try accessing it. There are plans to improve this further, so this API may change in a future version. If it does, the changes will be mentioned in the release notes. To access the API, you hit the following endpoint:
http(s)://[hostname]/api/v3/enterprise/stats/
There are a variety of options to choose from:
all
- returns all available statsrepos
- returns only repository-related statshooks
- returns only hooks-related statspages
- returns only pages-related statsorgs
- returns only organization-related statsusers
- returns only user-related statspulls
- returns only pull request-related statsissues
- returns only issue-related statsmilestones
- returns only milestone-related statsgists
- returns only gist-related statscomments
- returns only comment-related stats
These stats are cached and update roughly every 10 minutes.
curl http://user:[email protected]/api/v3/enterprise/stats/all
{
"issues": {
"total_issues": 610,
"closed_issues": 505,
"open_issues": 105
},
"hooks": {
"total_hooks": 0,
"active_hooks": 0,
"inactive_hooks": 0
},
"milestones": {
"closed_milestones": 7,
"open_milestones": 4,
"total_milestones": 11
},
"orgs": {
"total_team_members": 232,
"disabled_orgs": 0,
"total_orgs": 17,
"total_teams": 32
},
"comments": {
"total_gist_comments": 0,
"total_commit_comments": 80,
"total_pull_request_comments": 47,
"total_issue_comments": 1166
},
"pages": {
"total_pages": 3
},
"users": {
"disabled_user": 0,
"admin_users": 48,
"total_users": 507
},
"gists": {
"private_gists": 0,
"public_gists": 0,
"total_gists": 0
},
"pulls": {
"mergeable_pulls": 38,
"merged_pulls": 178,
"unmergeable_pulls": 11,
"total_pulls": 250
},
"repos": {
"fork_repos": 7,
"root_repos": 153,
"total_repos": 153,
"total_pushes": 0,
"org_repos": 17,
"total_wikis": 0
}
}
Any plans to allow non-admin users to access the stats API?