Skip to content
Snippets Groups Projects
Unverified Commit 073f3b92 authored by github-automation-metabase's avatar github-automation-metabase Committed by GitHub
Browse files

logs should not be translated (#49033) (#49040)

parent b8178a84
Branches
Tags v0.9-final
No related merge requests found
......@@ -14,7 +14,7 @@
[metabase.server :as server]
[metabase.server.request.util :as req.util]
[metabase.util :as u]
[metabase.util.i18n :as i18n :refer [deferred-tru trs]]
[metabase.util.i18n :as i18n :refer [deferred-tru]]
[metabase.util.log :as log]
[toucan2.core :as t2])
(:import
......@@ -45,7 +45,7 @@
(str
(format "%s %s %d" (u/upper-case-en (name request-method)) uri status)
(when async-status
(format " [%s: %s]" (trs "ASYNC") async-status))))
(format " [ASYNC: %s]" async-status))))
(defn- format-performance-info
[{:keys [start-time call-count-fn _diag-info-fn]
......@@ -53,28 +53,28 @@
call-count-fn (constantly -1)}}]
(let [elapsed-time (u/format-nanoseconds (- (System/nanoTime) start-time))
db-calls (call-count-fn)]
(trs "{0} ({1} DB calls)" elapsed-time db-calls)))
(format "%s (%s DB calls)" elapsed-time db-calls)))
(defn- stats [diag-info-fn]
(str
(when-let [^PoolBackedDataSource pool (let [data-source (mdb/data-source)]
(when (instance? PoolBackedDataSource data-source)
data-source))]
(trs "App DB connections: {0}/{1}"
(.getNumBusyConnectionsAllUsers pool) (.getNumConnectionsAllUsers pool)))
(format "App DB connections: %s/%s"
(.getNumBusyConnectionsAllUsers pool) (.getNumConnectionsAllUsers pool)))
" "
(when-let [^QueuedThreadPool pool (some-> (server/instance) .getThreadPool)]
(trs "Jetty threads: {0}/{1} ({2} idle, {3} queued)"
(.getBusyThreads pool)
(.getMaxThreads pool)
(.getIdleThreads pool)
(.getQueueSize pool)))
(format "Jetty threads: %s/%s (%s idle, %s queued)"
(.getBusyThreads pool)
(.getMaxThreads pool)
(.getIdleThreads pool)
(.getQueueSize pool)))
" "
(trs "({0} total active threads)" (Thread/activeCount))
(format "(%s total active threads)" (Thread/activeCount))
" "
(trs "Queries in flight: {0}" (thread-pool/active-thread-count))
(format "Queries in flight: %s" (thread-pool/active-thread-count))
" "
(trs "({0} queued)" (thread-pool/queued-thread-count))
(format "(%s queued)" (thread-pool/queued-thread-count))
(when diag-info-fn
(when-let [diag-info (not-empty (diag-info-fn))]
(format
......
......@@ -6,7 +6,6 @@
[clojure.string :as str]
[clojure.tools.namespace.find :as ns.find]
[metabase.util.format :as u.format]
[metabase.util.i18n :refer [tru]]
[metabase.util.log :as log]
[nano-id.core :as nano-id])
(:import
......@@ -284,7 +283,7 @@
(when (= result ::timeout)
(when (future? reff)
(future-cancel reff))
(throw (TimeoutException. (tru "Timed out after {0}" (u.format/format-milliseconds timeout-ms)))))
(throw (TimeoutException. (format "Timed out after %s" (u.format/format-milliseconds timeout-ms)))))
result))
(defn do-with-timeout
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment