So, at my spare time, I work a bit on my pet projects called memory. This is a simple virtual memory written on Java. User can allocate a large space of memory and then use it to allocate and free some blocks of it for personal use.
My main interest was to implement some memory allocation algorithms that could be working in concurrent environment with minimal of locks. I'm still on my way with it however, have some progress.
One of the problems with such projects is the way you can measure performance and quality. And what is more important, how you can assess you changes in these fields. Without a good set of performance tests, you can't know if your changes are for good. But having tests is not enough. You need to have metrics and gather them, and represent them in some charts for better visibility. Visualization matters. And then, when you have a way to look at those charts you can examine your's changes much much easier and better.
So that's what I did. First, wrote a simple metric gathering framework for internal use. Then added
metrics and used CodaHale Metrics to gather metrics data and save into CSV file.
Simple Ruby script makes needed conversion, merging and somewhere aggregation to prepare data files that could be used for charts.
And Gnuplot is used to build charts for those data files. Although that was possible to build chart based on multiple data files, I decided to add extra logic to scripts to merge and aggregate some data. It's so convenient when you can view the raw data that was used to build a chart.
I've spent some time investigating how to use gnuplot to build somehow beautiful charts. After spending a few hours and reading a lot of resources over the internet, I've stopped on the next script:
So there are some examples of result charts:
Two different values are shown on this graph.
Barely seen lightgray line is very helpful in some moments, especially if graph is spiky.
I'm almost ready to push all related changes to the memory repository, but have some moments I want to polish, and some functionality to add.
Those graphs helped me to find some issues in the allocation algorithm and fix them. Actually, I use a single page with a set of different charts:
Clickable.
Not awesome. But pretty nice and, what is more important, it helps.
No comments:
Post a Comment