   (:require [clj-time.core :as time]
             [clj-time.format :as time-format]
             [clj-time.coerce :as time-coerce]
+            [clj-time.periodic :as time-periodic]
             [qbits.alia :as alia]
             [qbits.hayt :as hayt]
             [tamarack.util :as util]))

                                     :errors (hayt/inc-by errors)})
                                   (hayt/where {:app_id app-id
                                                :endpoint endpoint
                                                :timestamp (time-coerce/to-long timestamp-minute)}))]
    (alia/execute session query-minute)))

(defn request-data-by-minute [app-id from to]

                                     60000))
                            60000)))

(defn timestamp-date-part [timestamp]
  (time-format/unparse timestamp-date-format timestamp))

(defn dates-between [from to]
  (let [interval (time/interval from (time/plus to (time/hours 24)))]
    (map timestamp-date-part
         (take-while (partial time/within? interval)
                     (time-periodic/periodic-seq from (time/hours 24))))))

(defn process-request-data [app-id data]
  (let [{errors :errors
         requests :requests
