analysis-tools-dev / website-old

⚙️ Source code of the official Analysis Tools website
https://analysis-tools.dev
MIT License
14 stars 13 forks source link

Analysis Tools Awards #27

Open mre opened 4 years ago

mre commented 4 years ago

Now that we get quite a bit of traffic on the website, we could start to provide a badge for the top N tools that we calculate from our webserver monitoring every month.

Posting the query here for future reference:

topk(20, sum(count_over_time({domain=~"(analysis-tools\\.dev|www\\.analysis-tools\\.dev)", path=~"/tool/.*"} [$__range])) by (path))
jakubsacha commented 4 years ago

Where do you invoke that query? In the cloudflare?

mre commented 4 years ago

On https://dash.jorgelbg.me. It's not publicly accessible, but I think we can query the Loki endpoint. My idea was to write a cronjob that fetches the information once per week and renders a static JSON with the top N tools which can then be used by Gatsby during the build process. We might have an optional top-badge, field for each node that points to a pre-rendered image. This way we can also show it on Github if we wanted (e.g. on our static-analysis repo or send a PR to the top tools).

mre commented 3 years ago

Posting my progress here so that I don't forget.

curl -G -s "http://loki.jorgelbg.me/loki/api/v1/query_range" --data-urlencode 'query=topk(20, sum(count_over_time({domain=~"(analysis-tools\\.dev|www\\.analysis-tools\\.dev)", path=~"/tool/.*"} [6d])) by (path))' --data-urlencode 'step=300' -H 'X-Scope-OrgID: xxxxx' | jq