Skip to content

Commit

Permalink
release: v0.3.0 - bump dependencies, prepare for 1config
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoBonacci committed Dec 17, 2020
1 parent 0634817 commit 7c5ce37
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
29 changes: 15 additions & 14 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@

:scm {:name "git" :url "https://github.com/BrunoBonacci/bad-boy.git"}

:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/tools.logging "1.0.0"]
[com.cognitect.aws/api "0.8.445"]
[com.cognitect.aws/endpoints "1.1.11.732"]
[com.cognitect.aws/ec2 "793.2.627.0"]
[com.cognitect.aws/autoscaling "792.2.622.0"]
[instaparse "1.4.10"]
[com.brunobonacci/where "0.5.5"]
[com.brunobonacci/safely "0.5.0"]
[com.brunobonacci/mulog "0.2.0"]]
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/tools.logging "1.1.0"]
[com.cognitect.aws/api "0.8.484"]
[com.cognitect.aws/endpoints "1.1.11.914"]
[com.cognitect.aws/ec2 "810.2.805.0"]
[com.cognitect.aws/autoscaling "810.2.801.0"]
[instaparse "1.4.10"]
[com.brunobonacci/where "0.5.5"]
[com.brunobonacci/safely "0.7.0-alpha1"]
[com.brunobonacci/mulog "0.5.0"]
[com.brunobonacci/mulog-elasticsearch "0.5.0"]
[com.brunobonacci/mulog-cloudwatch "0.5.0"]]

:global-vars {*warn-on-reflection* true}

Expand All @@ -32,17 +34,16 @@
{:aot :all
;; temp fix for logging
:dependencies [[ch.qos.logback/logback-classic "1.2.3"]
[org.codehaus.janino/janino "3.1.1"]
[com.brunobonacci/mulog-elasticsearch "0.2.0"]
[org.codehaus.janino/janino "3.1.2"]
[com.internetitem/logback-elasticsearch-appender "1.6"
:exclusions [com.fasterxml.jackson.core/jackson-core]]
[clj-time "0.15.2"]]
:resource-paths ["dev-resources"]}

:dev
{:dependencies [[midje "1.9.9"]
[org.clojure/test.check "1.0.0"]
[criterium "0.4.5"]
[org.clojure/test.check "1.1.0"]
[criterium "0.4.6"]
[ch.qos.logback/logback-classic "1.2.3"]]
:resource-paths ["dev-resources"]

Expand Down
2 changes: 1 addition & 1 deletion resources/bad-boy.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.8
0.3.0
39 changes: 19 additions & 20 deletions src/com/brunobonacci/bad_boy/main.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,17 @@
"start the events publisher, returns a function to stop the publishers"
[]
(u/set-global-context!
{:app-name "bad-boy" :env (env)
:version (version) :puid (ut/puid)})
{:app-name "bad-boy" :env (env)
:version (version) :puid (ut/puid)})


(let [stop*
(when (= "1" (System/getenv "BADBOY_METRICS_ENABLED"))
(let [publisher-type (keyword (or (System/getenv "BADBOY_METRICS_REPORTER") "console"))
destination (or (System/getenv "BADBOY_METRICS_DEST") "http://localhost:9200/")]
(log/info "Starting metrics reporting to: " publisher-type "-" destination)
(if (= :elasticsearch publisher-type)
(u/start-publisher! {:type :elasticsearch :url destination})
(u/start-publisher! {:type :console}))))]
(let [publisher-conf
(read-string
(or (System/getenv "BADBOY_PUBLISHER_CONF")
(pr-str {:type :console :pretty? true})))]
(log/info "Starting metrics reporting to: " publisher-conf)
(u/start-publisher! publisher-conf))]

(fn []
(when stop*
Expand All @@ -60,8 +59,8 @@
(defn header
[cmd]
(println
(format
"
(format
"
============================================================
---==| B A D - B O Y |==---
Expand All @@ -77,13 +76,13 @@
Killer-run : %s group, rate: %s
============================================================
" (version)
(java.util.Date.)
(boolean (or (:dry-run cmd) (System/getenv "DRY_RUN")))
(pr-str (:targets cmd))
(pr-str (:killer-run cmd))
(if (:killer-run cmd)
(get-in core/DEFAULT-CONFIG [:groups (:killer-run cmd) :attack-rate] "???")
"none"))))
(java.util.Date.)
(boolean (or (:dry-run cmd) (System/getenv "DRY_RUN")))
(pr-str (:targets cmd))
(pr-str (:killer-run cmd))
(if (:killer-run cmd)
(get-in core/DEFAULT-CONFIG [:groups (:killer-run cmd) :attack-rate] "???")
"none"))))



Expand Down Expand Up @@ -122,8 +121,8 @@ Killer-run : %s group, rate: %s
(:killer-run cmd)
(let [cfg (if (:targets cmd)
(assoc-in core/DEFAULT-CONFIG
[:groups (:killer-run cmd) :targets]
(cli/build-filters cmd))
[:groups (:killer-run cmd) :targets]
(cli/build-filters cmd))
core/DEFAULT-CONFIG)
_ (header cmd)
stop (start-events-publisher!)]
Expand Down

0 comments on commit 7c5ce37

Please sign in to comment.