                   :url    (:url b)
                   :source b}) (:builds build))))
 
-(defn builds
+(defn read-jenkins-builds
   [connection jobs]
   (flatten (map #(read-build connection %) jobs)))
-
-(defn timestamp
-  []
-  (new Date))
 
 (defn make-build-metric
   [connection server build]

  (:require [cheshire.core :refer :all]
            [clojure.tools.logging :as log]
            [kuona-core.util :as util]
            [clj-http.client :as http])
  (:import (java.util Date)))

(defn job-to-job
  [job]
  {:name (:name job)
   :url  (:url job)})

(defn jobs
  [connection url]
  (let [response (connection url)
        result (map job-to-job (:jobs response))]
    result))


(defn parse-json
  [content]
  (parse-string content true))

(defn http-source
  [credentials]

    (let [uri (str url "/api/json")
          http-credentials {:basic-auth [(:username credentials) (:password credentials)]}
          response (http/get uri http-credentials)
          content (util/parse-json-body response)]
      content)))

(defn read-build
