Add method to calculate total size of artifacts in subpath
Purpose of this MR is to synchronize code introduced in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/117 into GitLab EE, to make our codebase more consistent. This came after a talk with @ayufan.