Search code examples
gitlabgitlab-api

Get total disk usage for user in GitLab (via API)


I'm trying to find a way to get the total disk usage for all of a user's projects via GitLab API. Note that this would only be for projects the user has created - not projects they are members of, etc.

I can do this by going through all of a user's projects and summing the repository size, but that can be slow, especially if the user has more than 100 projects and you have to paginate. Curious if there's some method I'm missing.

Thanks!


Solution

  • Only a graphQL query would be faster than the regular GitLab API.

    GitHub has one.
    GitLab announced its intention to support one.
    The 10.0+ version should now support GraphQL as a POC.
    But it won't be available before 11.x in 2018 Q2.