Skip to contents

Calls get_db_activity and appends one row per active connection to connections_log.csv and one row per database to stats_log.csv. Designed to be called on a regular schedule (e.g. every 30 minutes via Windows Task Scheduler).

Usage

log_db_snapshot(con, log_dir, verbose = TRUE)

Arguments

con

A database connection from call.mydb.

log_dir

Directory containing the log files. Will be initialised with init_activity_log if it does not exist yet.

verbose

Logical. Print a one-line confirmation? Default TRUE.

Value

The db_activity snapshot (invisibly).

Examples

if (FALSE) { # \dontrun{
con <- call.mydb()
log_db_snapshot(con, log_dir = "~/db_logs")
} # }