Festive Graphite Line Art for the Masses

You have an installation of Graphite, a desire to learn more Ruby, and some festive spirit – what emerges?

An xmas tree drawn using proper metrics via the Ruby graphite gem, of course!

Xmas tree plotted using Graphite

The magic happens with the Graphite::Logger class, because we can log metrics at specific points in time:

logger.log(when,{"Branches1" => 3})

I calculated the points to plot on paper, and found decent Graphite rendering settings by experimentation:

Planning the Graphite Xmas tree

The code is on Github here: https://github.com/matthewskelton/GraphiteGreetings – fork away!

I’d love to hear or see any suggestions for improvements to the script. Candles? Snowflakes? Reindeer?! Also, as my Ruby-fu is limited, if there are better ways of interacting with Graphite, I’d love the hear about them (I tried and failed to get activesupport to work on my machine, for example).

One thought on “Festive Graphite Line Art for the Masses

Join the discussion...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s