diff --git a/README.md b/README.md index f0ada8c..1a75555 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,43 @@ 6. Edit all stuff that is `ARI-WEB-SPECIFIC` in [netlify.toml](/netlify.toml) 7. Publish on [netlify](https://netlify.com/) +# Usage API + +The [usage api](https://www.ari-web.xyz/api/usage.json) +has all the statistics I get from netlify, it serves as +an archive and growth monitor + +Schema: + +```json +{ + "": { + "total": , + "top": { + "": , + "": , + "": + } + } +} +``` + +The date is the day I added those stats, total is total +bandwidth used up to that point, top is the top 3 site's +usage and its keys are the (sub)domain names and the values +of those keys are the used bandwidth out of the total + +The bandwidth keys are all floats for easy parsing, they +represent the bandwidth used in MB + +The top sites will most likely not have the total bandwidth +fully used, so as a measure you can use this formula to calculate +how much per avg sites are using: + +```py +(data[""]["total"] - sum(data[""]["top"].values())) / (len(ari_web_sites) - 3) +``` + # Subdomains - https://www.ari-web.xyz/ (source: https://ari-web.xyz/git) diff --git a/api/sitelist.json b/api/sitelist.json index 79992e7..4d31633 100644 --- a/api/sitelist.json +++ b/api/sitelist.json @@ -1,11 +1,8 @@ -{ - "desc": "Ari-web site list", - "data": [ - "www.ari-web.xyz", - "files.ari-web.xyz", - "blog.ari-web.xyz", - "legacy.blog.ari-web.xyz", - "school.ari-web.xyz", - "user.ari-web.xyz" - ] -} +[ + "www.ari-web.xyz", + "files.ari-web.xyz", + "blog.ari-web.xyz", + "legacy.blog.ari-web.xyz", + "school.ari-web.xyz", + "user.ari-web.xyz" +] diff --git a/api/usage.json b/api/usage.json new file mode 100644 index 0000000..36a6b1c --- /dev/null +++ b/api/usage.json @@ -0,0 +1,10 @@ +{ + "2022-08-17": { + "total": 137.0, + "top": { + "files.ari-web.xyz": 45.1, + "legacy.blog.ari-web.xyz": 31.8, + "www.ari-web.xyz": 29.9 + } + } +} diff --git a/scripts/apis.sh b/scripts/apis.sh index 343bda5..18f694e 100755 --- a/scripts/apis.sh +++ b/scripts/apis.sh @@ -16,7 +16,7 @@ main() { { printf '%s' '[' find api -type f -exec basename {} \; | mkdata - echo "\"$(basename "$apis")\"]" + echo ']' } >"$apis" echo 'done'