Skip to content

Instantly share code, notes, and snippets.

View donbonifacio's full-sized avatar
🚀
Building platforms

Pedro Pereira Santos donbonifacio

🚀
Building platforms
View GitHub Profile

Monitoring

  • rabbitmqctl status - generic node info
  • rabbitmqctl cluster_status - checks connectivity with other nodes and alarms

Troubleshoot

Consumer prefetch

By default Rabbit will prefetch several messages to boost performance. If the consumption

obb-rules[obb-spec]$ OBB_SCENARIOS_TO_TEST=0 lein with-profile clj run
Testing obb-rules.board-test
Testing obb-rules.actions.go-to-test
Testing obb-rules.actions.strikeback-test
Testing obb-rules.actions.damage-calculator-test

vmstat <ms>

Shows virtual memory stats every ms millis.

jps -lvm

Shows the java processes running, their PID, and command line arguments.

jcmd <pid> help

JVM: “Elapsed time: 22s”
Jodejs: “Elapsed time: 104s”
Phantomjs “Elapsed time: 155s”
(ns obb-rules.evaluator-test
(:require
#?(:cljs [cljs.test.check :as tc])
#?(:clj [clojure.test.check.generators :as gen]
:cljs [cljs.test.check.generators :as gen])
#?(:clj [clojure.test.check.properties :as prop]
:cljs [cljs.test.check.properties :as prop :include-macros true])
#?(:clj [clojure.test.check.clojure-test :refer [defspec]]
:cljs [cljs.test.check.cljs-test :refer-macros [defspec]])
#?(:clj [clojure.test :refer [deftest testing is run-tests]]
(ns obb-rules.action-test
(:require
#?(:clj [clojure.test :refer [deftest testing is run-tests]]
:cljs [cljs.test :refer-macros [deftest testing is run-tests]])))
lein with-profile clj run
lein with-profile cljs-node cljsbuild test
lein with-profile cljs-browser cljsbuild test
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Clojure Common 84 682 6 4425
Clojure 1 3 0 13
ClojureScript 1 5 0 10
-------------------------------------------------------------------------------
SUM: 86 690 6 4448
-------------------------------------------------------------------------------
@donbonifacio
donbonifacio / gist:b48f992b461d6bb321eb
Last active August 29, 2015 14:19
Mongo gateway implementation
(defn save!
"Persists an account"
[account]
(-> (common/db)
(mc/save-and-return "accounts" account)))
(defn find-by-id
"Find account by given query"
[id]
(-> (common/db)