measure_subnet_timeout: Measure timeout of subnet, or switch.

Description Usage Arguments Value Examples

View source: R/measure_subnet_timeout.R

Description

Measure timeout of subnet, or switch.

Usage

1
measure_subnet_timeout(log_df, N = 1L, address_all = NULL)

Arguments

log_df

A data.frame that records the log.

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').

Value

A data frame with following columns:

data.frame

Examples

 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)
)

atusy/pingAnalysis documentation built on Jan. 3, 2022, 12:47 p.m.