Skip to content

Commit

Permalink
try report by ns
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmn3 committed Dec 13, 2021
1 parent bfc2f1e commit 80dd3aa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Clojure's [threading macros](https://clojure.org/guides/threading_macros) (the `
Place the following in the `:deps` map of your `deps.edn` file:
```clojure
...
net.clojars.john/injest {:mvn/version "0.1.0-beta.5"}
net.clojars.john/injest {:mvn/version "0.1.0-beta.6"}
...
```
### clj-kondo
Expand All @@ -30,7 +30,7 @@ To try it in a repl right now with `criterium` and `net.cgrand.xforms`, drop thi
```clojure
clj -Sdeps \
'{:deps
{net.clojars.john/injest {:mvn/version "0.1.0-beta.5"}
{net.clojars.john/injest {:mvn/version "0.1.0-beta.6"}
criterium/criterium {:mvn/version "0.4.6"}
net.cgrand/xforms {:mvn/version "0.19.2"}}}'
```
Expand Down
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(:require [org.corfield.build :as bb]))

(def lib 'net.clojars.john/injest)
(def version "0.1.0-beta.5")
(def version "0.1.0-beta.6")

;; clojure -T:build ci
;; clojure -T:build deploy
Expand Down
8 changes: 3 additions & 5 deletions src/injest/report.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
(def report-live? (atom false))
(def report-taps (atom {}))

(defn flc [form-meta]
(let [f #?(:clj *file* :cljs (namespace ::x))
{:as m :keys [line column]} form-meta
k (str f "?line=" line "&col=" column)]
k))
(defn flc [f form-meta]
(let [{:as m :keys [line column]} form-meta]
(str f "?line=" line "&col=" column)))

(defn now []
#?(:clj (.toEpochMilli (java.time.Instant/now))
Expand Down
4 changes: 2 additions & 2 deletions src/injest/report/path.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
`(if-not @r/report-live?
(injest.path/x>> ~x ~@thread)
(let [a?# (= 0 (rand-int 2))
k# (r/flc ~(meta &form))]
k# (r/flc ~(namespace ::x) ~(meta &form))]
(if a?#
(r/monitor k# injest.path/x>> ~(concat [x] thread))
(r/monitor k# injest.path/+>> ~(concat [x] thread))))))
Expand All @@ -48,7 +48,7 @@
`(if-not @r/report-live?
(injest.path/x>> ~x ~@thread)
(let [n# (rand-int 3)
k# (r/flc ~(meta &form))]
k# (r/flc ~(namespace ::x) ~(meta &form))]
(case n#
0 (r/monitor k# injest.path/=>> ~(concat [x] thread))
1 (r/monitor k# injest.path/x>> ~(concat [x] thread))
Expand Down

0 comments on commit 80dd3aa

Please sign in to comment.