   (: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]

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

(defn process-endpoint-data [app-id data]
