Monitoring Repositories

ARTIFACTORY: how to get binary size of a repository

AuthorFullName__c
Jian Sun
articleNumber
000005698
ft:sourceType
Salesforce
FirstPublishedDate
2023-04-27T15:52:52Z
lastModifiedDate
2023-04-27
VersionNumber
3
We understand that calculating a deduplicated size of the artifacts in a repo can be useful and we can make that happen using the AQL/SQL.

For example, the Python3 script in this KB (Why the storage info REST API account duplicate docker layers and how we can avoid it?)(Set the base_url & auth first), will get you the size of each repo if each checksum is counted once and print out the results.

If you don't understand the python script, you can get the same result using the Linux Shell, docker-local is the repository name in this example:
$ curl -XGET -uadmin:'password' 'http://192.168.xx.xx:8082/artifactory/api/storage/docker-local?list&deep=1&listFolders=0&mdTimestamps=0' |jq -r '.files | .[] | "\(.sha1), \(.size)"' |sort |uniq |awk '{sum += $2} END {print sum, "byes."}'