Skip to content

Instantly share code, notes, and snippets.

@citizen428
Created February 25, 2010 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save citizen428/315191 to your computer and use it in GitHub Desktop.
Save citizen428/315191 to your computer and use it in GitHub Desktop.
(use '(incanter core charts io))
(def usage (read-dataset "report.csv" :header true))
(def instance-types
(set (filter #(re-find #"BoxUsage" %) ($ :UsageType usage))))
(with-data (->> ($rollup :sum :UsageValue :UsageType usage)
($where {:UsageType {:$in instance-types}}))
(view (bar-chart :UsageType :UsageValue
:title "EC Instance Usage"
:x-label "Instance Types"
:y-label "Usage Value")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment