Skip to content

Commit

Permalink
stats_show()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Sep 17, 2023
1 parent 6740174 commit 2a5fdc5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
14 changes: 14 additions & 0 deletions R/stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@ stats <- new_environment(list(attempts = 0L, fallback = 0L, calls = character())

#' Show stats
#'
#' Prints statistics on how many calls were handled by DuckDB.
#'
#'
#' @return Called for its side effect.
#'
#' @export
#' @examples
#' stats_show()
#'
#' tibble(a = 1:3) %>%
#' as_duckplyr_df() %>%
#' mutate(b = a + 1)
#'
#' stats_show()
stats_show <- function() {
writeLines(paste0(
c("\U0001f6e0", "\U0001f528", "\U0001f986"),
Expand All @@ -11,4 +24,5 @@ stats_show <- function() {
))
calls <- sort(gsub("[.]duckplyr_df", "", stats$calls))
writeLines(paste(calls, collapse = ", "))
invisible()
}
14 changes: 13 additions & 1 deletion man/stats_show.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2a5fdc5

Please sign in to comment.