representing metrics as words cloud
I was working on a presentation of an internal service I’m working. In the service we have many entities (sorry, no details here for now), each generates inbound and outbound traffic.
Preparing Data
The service has an endpoint with whole metrics we collect. That is an enormously huge JSON file, that one can fetch from an HTTP endpoint.
There is too much data event to feed some Grafana solution. So we need to filter/normalize the data first.
I use amazing jq. Great tool to update/fetch/patch/present data. On macOS
you may simply say brew install jq
to have it.
Fetching data in the console can be done simply too. I use curl for that.
The finally, to prepare the data, I use to following snipped
The output from the tool was like the following
That is the data to feed into a words/tags cloud generator.
Generating a Tags Cloud
I failed to find any good online service to implement the task in several clicks. Finally, I found a fantastic Python library called word_cloud.
Frankly, I’m not a python expert. I found an example and managed to turn it to my need in PyCharm.
That is the snipped I finally did
Conclusion
I’m happy I came across several amazing tools, and it turned to be easy and fun to generate some analytics ‘reports’ like that:
I use Marvell character names instead of real names :)
comments powered by Disqus