by tw1010 · 9y ago · 0 comments
Any new HR product should have a hero page with:
- a couple of sparklines
- a mugshot of user/candidate
- some important looking numbers in a giant-assed sans serif font
Throw in a social media-like feed down the side of the page for added oomph.
Things have moved on from the days when a pie chart was table stakes.
Spark is awesome - makes it dead easy to parallelize work.
But it's also easy to write bad Spark code that doesn't parallelize well.
So I wrote a report to let us view key stats broken out by Spark job, including a sparkline of avg load on the machines running the job for its duration.
This provides an easy way to see whether a job uses the cluster efficiently, and if it doesn't, where the key points in the job are that it's sitting idle.
It also lets us eyeball the repeatability -- if a given batch job's sparklines are wildly varying from run to run, it usually suggests that something funky is going on in the code.
Also, it lets us have "Spark" lines. Worth it for the pun alone, IMO.
Let's say you have X buckets, with Y slots each. Each tick, you put the current value in the current slot of the first bucket, and advance the index by one. When the index reaches the number of slots, reset the index to 0, and put the average of all slots of the first bucket into the current slot of the second bucket. When the second bucket overflows, put the average into the current slot of the third bucket, and so on. This way you can fit both current and very old values into the same tiny graph, to give a rough impression of "level of activity" (e.g. for tray icons).
If that doesn't have a name yet because I invented it (I doubt that), I call it syrup buckets (syrup is how it can look like depending on the amount of buckets, slots and the tick speed).