Liking cljdoc? Tell your friends :D

actionho-commons.db


batch-sizeclj


db-all-query-count-tlclj


db-insert-query-count-tlclj


db-posix-search-query-count-tlclj


db-select-query-count-tlclj


db-update-query-count-tlclj


db-workload-light-recently?clj

(db-workload-light-recently?)

Arbitrary threshold for a good-time to do more db-intensive interval tasks. if threshold is 10 ops per second, that's 10 * 60 = 600 ops per minute

Arbitrary threshold for a good-time to do more db-intensive interval tasks.
if threshold is 10 ops per second, that's 10 * 60 = 600 ops per minute
raw docstring

enable-db-loggingclj


get-num-db-ops-in-last-minuteclj

(get-num-db-ops-in-last-minute)

get-sql-timestamp-from-utc-zoned-dtclj

(get-sql-timestamp-from-utc-zoned-dt utc-zoned-dt)

Assumes that zoned-dt in in UTC timezone, java.sql.Timestamp, which is a sublcass of java.util.Date (https://docs.oracle.com/javase/8/docs/api/java/util/Date.html), is put into db verbatim without timezone info, so numbers need to represent utc time Need to use deprecated constructor, otherwise millisecond constructor will convert it to local time on db entry, which is really stupid. Also need to remember converting to java.util.Date numbers, which is again really stupid

Assumes that zoned-dt in in UTC timezone, java.sql.Timestamp, which is a sublcass of java.util.Date (https://docs.oracle.com/javase/8/docs/api/java/util/Date.html), is put into db verbatim without timezone info, so numbers need to represent utc time
Need to use deprecated constructor, otherwise millisecond constructor will convert it to local time on db entry, which is really stupid.
Also need to remember converting to java.util.Date numbers, which is again really stupid
raw docstring

get-sql-timestamp-utc-nowclj

(get-sql-timestamp-utc-now)

inc-db-count-tlclj

(inc-db-count-tl tl)

increment-num-db-ops-in-last-minuteclj

(increment-num-db-ops-in-last-minute)

A running count of db ops made in last minute. Keeps track of it in a vec, which is lready in sorted by time, so just need to go through and prune from beginning to get ops from last minute Can add info about requests if want to, but unneeded for now

A running count of db ops made in last minute.
Keeps track of it in a vec, which is lready in sorted by time, so just need to go through and prune from beginning to get ops from last minute
Can add info about requests if want to, but unneeded for now
raw docstring

local-date->sql-dateclj

(local-date->sql-date local-date)

num-db-ops-in-last-minute-vec-atomclj


(print-db-query-stats log-level-keyword header-str)

For now print directly to logl, can do plain string afterwards if needed, though new-lines may be a bit tricker to format

For now print directly to logl, can do plain string afterwards if needed, though new-lines may be a bit tricker to format
raw docstring

prune-num-db-ops-in-last-minuteclj

(prune-num-db-ops-in-last-minute vec-atom)

Makes sure that atom doesn't contain more than number of ops in last minute. Doesn't use (filter) as we know it's sorted, so no need to go through all items Pass in atom as this not meant to be accessed by client code as it were.

Makes sure that atom doesn't contain more than number of ops in last minute.
Doesn't use (filter) as we know it's sorted, so no need to go through all items
Pass in atom as this not meant to be accessed by client code as it were.
raw docstring

reset-db-query-count-atomsclj

(reset-db-query-count-atoms)

sql-timestamp->local-dateclj

(sql-timestamp->local-date sql-timestamp)

sql-timestamp->zoned-dtclj

(sql-timestamp->zoned-dt sql-timestamp)

Sql timestamps automatically convert datetime value in db (with not timezone info), assumed to be UTC, into a local date time, which is then converted into UTC datetime (ZonedDateTime)

Sql timestamps automatically convert datetime value in db (with not timezone info), assumed to be UTC, into a local date time, which is then converted into UTC datetime (ZonedDateTime)
raw docstring

zoned-dt->sql-timeclj

(zoned-dt->sql-time zoned-date-time)

Must use deprecated constructor, can't use milliseconds constructor as that just converts it to localtime on storage instead of utc, as java.sql.Time is wrapper around timezone-less java.util.Date, really dumb

Must use deprecated constructor, can't use milliseconds constructor as that just converts it to localtime on storage instead of utc, as java.sql.Time is wrapper around timezone-less java.util.Date, really dumb
raw docstring

zoned-dt->sql-timestampclj

(zoned-dt->sql-timestamp zoned-dt)

Sql Timestamp is both date and time, assumes zoned-dt is in UTC

Sql Timestamp is both date and time, assumes zoned-dt is in UTC
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close