ARTIFACTORY: How to calculate the Usage in JFrog Artifactory Cloud
The goal of this article is to explain how the Billing and Usage calculations are made when working with Artifactory Cloud.
It is currently possible to monitor the Usage and Billing in MyJFrog Portal, but how exactly are we calculating the data that is reflected there?
Understanding the data
You may understand the data in more detail once you Export a CSV from the portal, for the time you wish to analyze. An example of such a CSV would be:
You can now easily see how the data usage was spread during that day, by filtering certain repositories or operations at a specific time.
Calculating the data
In order to summarize all the data you see in the Usage chart at MyJFrog, please follow the steps below:
2. The data inside should be structured as a JSON file in the following format:
{
"billing_timestamp": "2023-05-30 11:00:00.000",
"server_name": "omerb",
"service": "artifactory",
"action": "upload",
"ip": "52.215.237.190",
"repository": "default-generic-local",
"project": "default",
"artifact_path": "hts-22-05-2023-15-32-15.tar.gz",
"user_name": "admin",
"package_type": "generic",
"repo_type": "local",
"consumption_unit": "bytes",
"quantity": 69371092
}Different types of operations to calculate
Under the hood, we calculate different types of operations:
- Regular downloads from Artifactory (status code - 200)
- Direct downloads from Amazon S3 (status code - 302)
- Direct downloads from Amazon Cloudfront (status code - 302)
- Replications, Federated Repositories
- Xray Scans
The data we see in ‘jfrog-billing-logs’ is aggregated from all relevant sources, and should add up to the information that is seen in the Usage diagram in the portal.
You may read more about enabling the Logging Solutions for Artifactory in this article.