From 3d92fe11b807dab431f2cad6ed1346411684b24d Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Tue, 21 Jun 2022 16:46:13 -0700 Subject: [PATCH] service check implementation --- src/clj/auto_ap/ledger.clj | 2 +- src/clj/auto_ap/square/core.clj | 2 +- src/cljc/auto_ap/utils.cljc | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/clj/auto_ap/ledger.clj b/src/clj/auto_ap/ledger.clj index 114f2e54..7faa6247 100644 --- a/src/clj/auto_ap/ledger.clj +++ b/src/clj/auto_ap/ledger.clj @@ -423,5 +423,5 @@ (log/error e))))) (mount/defstate touch-broken-ledger-worker - :start (scheduler/every reconciliation-frequency (heartbeat touch-broken-ledger :touch-broken-ledger)) + :start (scheduler/every reconciliation-frequency (heartbeat touch-broken-ledger "touch-broken-ledger")) :stop (scheduler/stop touch-broken-ledger-worker)) diff --git a/src/clj/auto_ap/square/core.clj b/src/clj/auto_ap/square/core.clj index 6aaf72b7..3e3893f3 100644 --- a/src/clj/auto_ap/square/core.clj +++ b/src/clj/auto_ap/square/core.clj @@ -502,7 +502,7 @@ (upsert-refunds client)))) (mount/defstate square-loader - :start (scheduler/every (* 4 59 60 1000) (heartbeat upsert-all :square-loading)) + :start (scheduler/every (* 4 59 60 1000) (heartbeat upsert-all "square-loading")) :stop (scheduler/stop square-loader)) diff --git a/src/cljc/auto_ap/utils.cljc b/src/cljc/auto_ap/utils.cljc index f0e32e38..2ec226f5 100644 --- a/src/cljc/auto_ap/utils.cljc +++ b/src/cljc/auto_ap/utils.cljc @@ -1,7 +1,7 @@ (ns auto-ap.utils #?@ (:clj - [(:require [clojure.tools.logging :as log])])) + [(:require [com.unbounce.dogstatsd.core :as statsd])])) (defn by ([f xs] @@ -86,10 +86,10 @@ (defn heartbeat [f id] (fn [] - #?(:clj - (do - (log/info "Heartbeat for " id) - (f)) - + #?(:clj (do + (f) + (statsd/service-check {:name (str id) + :status :ok} + nil)) :cljs (do (println "Heartbeat for " id) (f)))))