diff --git a/NAMESPACE b/NAMESPACE index 008942b..28948b2 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,6 +4,7 @@ export(benchmark_results) export(benchmarks) export(compare_results) export(compare_runs) +export(conbench_info) export(conbench_perform) export(conbench_request) export(hardware) diff --git a/R/conbench_info.R b/R/conbench_info.R new file mode 100644 index 0000000..94523a1 --- /dev/null +++ b/R/conbench_info.R @@ -0,0 +1,16 @@ +#' Get a list of conbench info +#' +#' @return the response +#' @export + +conbench_info <- function() { + req <- req_url_path_append(conbench_request(), "ping") + + resp <- conbench_perform(req) + + dat <- resp_body_json(resp, simplifyVector = TRUE, flatten = TRUE) + + dat[["date"]] <- NULL + + dat +} diff --git a/R/zzz.R b/R/zzz.R new file mode 100644 index 0000000..8cd4190 --- /dev/null +++ b/R/zzz.R @@ -0,0 +1,19 @@ +.onAttach <- function(libname, pkgname) { + if (interactive()) { + load_msg <- tryCatch( + { + msg <- conbench_info() + packageStartupMessage( + paste0( + "Conbench server information\n", + paste0(" - ", names(msg), ": ", msg, collapse = "\n") + ), + "\n" + ) + }, + error = function(e) { + packageStartupMessage("No available conbench info") + } + ) + } +} diff --git a/man/conbench_info.Rd b/man/conbench_info.Rd new file mode 100644 index 0000000..7cbb874 --- /dev/null +++ b/man/conbench_info.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conbench_info.R +\name{conbench_info} +\alias{conbench_info} +\title{Get a list of conbench info} +\usage{ +conbench_info() +} +\value{ +the response +} +\description{ +Get a list of conbench info +}