This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-17
Channels
- # announcements (11)
- # beginners (29)
- # calva (2)
- # clara (12)
- # cljsjs (1)
- # cljsrn (7)
- # clojure (39)
- # clojure-europe (6)
- # clojure-nl (7)
- # clojure-spec (6)
- # clojure-sweden (1)
- # clojure-uk (15)
- # clojuredesign-podcast (6)
- # code-reviews (2)
- # conjure (29)
- # cursive (3)
- # datomic (13)
- # duct (15)
- # emacs (1)
- # figwheel-main (2)
- # fulcro (7)
- # graalvm (16)
- # lambdaisland (4)
- # luminus (1)
- # meander (15)
- # observability (15)
- # off-topic (27)
- # parinfer (7)
- # pathom (2)
- # reitit (2)
- # rum (11)
- # shadow-cljs (57)
- # spacemacs (6)
- # sql (56)
- # tools-deps (36)
- # xtdb (3)
you can use hprof and/or visualvm (free) yourkit (paid)
it's the jvm, the jvm has good tooling for this stuff
For example in this function call the timbre log lines adds 3 seconds per function call and the sql query adds half a second. overall takes about 5 seconds to run the first deposit and adds a second per deposit
(defn re-check-edeposits
[db opts depositid]
(fn [request]
(let [_ (timbre/info ::check-edeposits (:headers request))
sn (get (-> request :headers) "x-vgs-sn")
db (assoc db :dbname sn)
deposits (jdbc/query db ["SELECT edeposittransactionid, trans_ref_no, bankdepositstaffid,
edeposittransactionid as order_id,depositamount,
'UNK' as payment_mode
FROM edeposit
WHERE edepositid =? " depositid])
_ (timbre/info ::check-edeposits|deposits (count deposits))
_ (doseq [d deposits]
(timbre/info ::check-edeposits|deposit d)
(validate-edeposit db opts d))]
(ruhr/ok {:data :running :status 200}))))
there's also newrelic
@noisesmith any good tutorials on how to use these hprof/newrelic with clojure? not finding anything helpful in my searches
clojure is a java library, all those tools care about is the jvm, which is there to use
you can simplify things by building a fat jar (uberjar) so they don't get confused by any tooling layers that might accidentally be running
Hey team, is there a recommended analog to gofmt / prettier that folks use for clojure? (would be great to have one command I can jig up to auto-fmt all the code)
hey @U0C5DE6RK, if you want to run cljfmt fix on each Push to GitHub, we created a tool that you can try: https://go.atomist.com/catalog/skills/atomist/cljfmt-skill and there's a version for zprint too: https://go.atomist.com/catalog/skills/atomist/zprint-skill You might find these useful if you're trying to get consistent formatting bootstrapped on a team (while everyone gets cljfmt/zprint/cljstyle into the envs).
Cool, thanks @U0143KP47M4!
here's the repo that implements the function if you're interested: https://github.com/atomist-skills/cljfmt-skill (this is the code that runs when the GitHub app detects a Push)
cljfmt has check mode and fix mode, but it's slower to start up than the kind of new stuff @borkdude makes
I knew tagging you in here would be a good idea :D
Is there a function that removes namespacing from keywords? Currently resorting to (keyword (name ::kw))
so that looks good
thanks, Alex!
is https://clojuredocs.org/ down for anyone else?
I thought my internet was out until I saw your message lol. Yes, down for me too
Yeah, we had a bunch of New Relic alerts appear briefly saying San Francisco couldn't reach our East Coast data center. Everything cleared in a few minutes.