 
 
 
-(defn get-segment-metrics 
+(defn- get-segment-metrics 
   "Get metrics based on segments"
   []
   (let [segments (db/select 'Segment)]
     {:segments (count segments)}))
 
 
-(defn get-metric-metrics 
+(defn- get-metric-metrics 
   "Get metrics based on metrics"
   []
   (let [metrics (db/select 'Metric)]
     {:metrics (count metrics)}))
 
-(defn bin-latencies 
+(defn- bin-latencies 
   "Bin latencies, which are in milliseconds"
   [query-executions]
   (let [latency-vals (map #(/ %1 1000) (map :running_time query-executions))]
     (frequencies (map bin-large-number latency-vals))))
 
 ;; Execution Metrics
-(defn get-execution-metrics 
+(defn- get-execution-metrics 
   "Get metrics based on executions. 
   This should be done in a single pass, as there might 
   be a LOT of query executions in a normal instance

     :num_cards_per_label (medium-histogram labels :label_id)}))

;; Metadata Metrics
(defn database-dims 
  "characterize a database record"
  [database]
  {:total 1
   :analysed (if (database :is_full_sync) 1 0)}
  )

(defn get-database-metrics 
  "Get metrics based on databases"
  []
  (let [databases (db/select 'Database)]
    {:databases (apply add-summaries (map database-dims databases))}))


(defn get-table-metrics 
  "Get metrics based on tables"
  []
  (let [tables (db/select 'Table)]

  )

;; User metrics
(defn- user-dims 
  "characterize a user record"
  [user]
  {:total 1
