Description Usage Arguments Value Examples
View source: R/measure_subnet_timeout.R
Measure timeout of subnet, or switch.
1 | measure_subnet_timeout(log_df, N = 1L, address_all = NULL)
|
log_df |
A |
N |
Threshold of continuous errors to be considered as fatal. |
address_all |
A character vector of all the IPv4 addresses to be logged. They must be suffixed by prefix-size (e.g., '192.168.1.1/24'). |
A data frame with following columns:
address: (chr) IPv4 addresses that suffered timeout.
start: (dttm) When server started to timeout.
end: (dttm) When server resumed or NA
if not resumed.
n_timeout: (int) Number of timeout before resume.
data.frame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Prepare data
basetime <- 20200101000000
pings <- c(
# 1 2 3 4 5 6 7 8 9 10
1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
1, 1, 0, 0, 0, 0, 1, 1, 0, 1,
1, 1, 1, 0, 0, 0, 0, 1, 0, 1
)
N <- length(pings) / 3L
log_df <- tibble::tibble(
timestamp = lubridate::ymd_hms(basetime + seq(N)) |> rep(3L),
address = paste0("192.168.1.", 1L:3L, "/24") |> rep(each = N),
ping = ifelse(pings == 0, NA_real_, pings)
)
# Measure
measure_subnet_timeout(
log_df,
N = 2L,
address_all = unique(log_df$address)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.