:jvm-opts["-Djava.awt.headless=true"]; prevent Java icon from randomly popping up in dock when running `lein ring server`
:jvm-opts["-server"; Run JVM in server mode as opposed to client -- see http://stackoverflow.com/questions/198577/real-differences-between-java-server-and-java-client for a good explanation of this
"-Djava.awt.headless=true"]; prevent Java icon from randomly popping up in dock when running `lein ring server`
:javac-options["-target""1.7","-source""1.7"]
:uberjar-name"metabase.jar"
:ring{:handlermetabase.core/app
...
...
@@ -114,7 +116,7 @@
:jvm-opts["-Dlogfile.path=target/log"
"-Xms1024m"; give JVM a decent heap size to start with
"-Xmx2048m"; hard limit of 2GB so we stop hitting the 4GB container limit on CircleCI
"-server"; Run JVM in server mode as opposed to client -- see http://stackoverflow.com/questions/198577/real-differences-between-java-server-and-java-client for a good explanation of this
"-Xverify:none"; disable bytecode verification when running in dev so it starts slightly faster
"-XX:+CMSClassUnloadingEnabled"; let Clojure's dynamically generated temporary classes be GC'ed from PermGen
"-XX:+UseConcMarkSweepGC"]; Concurrent Mark Sweep GC needs to be used for Class Unloading (above)
:aot[metabase.logger]}; Log appender class needs to be compiled for log4j to use it
...
...
@@ -127,15 +129,19 @@
"-Dmb.db.in.memory=true"
"-Dmb.jetty.join=false"
"-Dmb.jetty.port=3010"
"-Dmb.api.key=test-api-key"
"-Xverify:none"]}; disable bytecode verification when running tests so they start slightly faster
"-Dmb.api.key=test-api-key"]}
;; build the uberjar with `lein uberjar`
:uberjar{:aot:all
:jvm-opts["-Dclojure.compiler.elide-meta=[:doc :added :file :line]"; strip out metadata for faster load / smaller uberjar size
"-Dmanifold.disable-jvm8-primitives=true"]}; disable Manifold Java 8 primitives (see https://github.com/ztellman/manifold#java-8-extensions)
:generate-sample-dataset{:dependencies[[faker"0.2.2"]; Fake data generator -- port of Perl/Ruby
;; generate sample dataset with `lein generate-sample-dataset`
:generate-sample-dataset{:dependencies[[faker"0.2.2"]; Fake data generator -- port of Perl/Ruby library
[incanter/incanter-core"1.9.1"]]; Satistical functions like normal distibutions}})
:source-paths["sample_dataset"]
:main^:skip-aotmetabase.sample-dataset.generate}
;; Profile Metabase start time with `lein profile`
:profile{:jvm-opts["-XX:+CITime"; print time spent in JIT compiler
"-XX:+PrintGC"]}; print a message when garbage collection takes place
;; Run reset password from source: MB_DB_PATH=/path/to/metabase.db lein with-profile reset-password run email@address.com
;; Create the reset password JAR: lein with-profile reset-password jar
;; This is the very first log message that will get printed.
;; It's here because this is one of the very first namespaces that gets loaded, and the first that has access to the logger
;; It shows up a solid 10-15 seconds before the "Starting Metabase in STANDALONE mode" message because so many other namespaces need to get loaded
(log/info"Loading Metabase...")
;; Set the default width for pprinting to 200 instead of 72. The default width is too narrow and wastes a lot of space for pprinting huge things like expanded queries
(intern'clojure.pprint'*print-right-margin*200)
...
...
@@ -707,3 +712,11 @@
(map?object-or-id)(recur(:idobject-or-id))
(integer?object-or-id)object-or-id
:else(throw(Exception.(str"Not something with an ID: "object-or-id)))))
(defmacroprofile
"Like `clojure.core/time`, but lets you specify a message that gets printed with the total time, and formats the time nicely using `format-nanoseconds`."
{:style/indent1}
[message&body]
`(let[start-time#(System/nanoTime)]
(prog1(do~@body)
(println(format-color'~'green"%s took %s"~message(format-nanoseconds(-(System/nanoTime)start-time#)))))))