   (:use [clojure.contrib.def :only [defnk]])
   (:use [clojure.contrib.seq-utils :only [find-first]])
   (:use [ring.adapter.jetty :only [run-jetty]])
+  (:use [clojure.string :only [trim]])
   (:import [backtype.storm.generated TaskSpecificStats
             TaskStats TaskSummary TopologyInfo SpoutStats BoltStats
             ErrorInfo ClusterSummary SupervisorSummary TopologySummary
             Nimbus$Client StormTopology GlobalStreamId])
+  (:import [java.io File])
   (:require [compojure.route :as route]
             [compojure.handler :as handler]
             [backtype.storm [thrift :as thrift]])

    (seq body)
    ]))

(defn cluster-summary-table [^ClusterSummary summ]
  (let [sups (.get_supervisors summ)
        used-slots (reduce + (map #(.get_num_used_workers ^SupervisorSummary %) sups))

        total-tasks (->> (.get_topologies summ)
                         (map #(.get_num_tasks ^TopologySummary %))
                         (reduce +))]
    (table ["Storm version" "Nimbus uptime" "Supervisors" "Used slots" "Free slots" "Total slots" "Running tasks"]
           [[(read-storm-version)
             (pretty-uptime-sec (.get_nimbus_uptime_secs summ))
             (count sups)
             used-slots
             free-slots
