Skip to contents

Runs benchmarks on multiple tables and compares download performance. Useful for monitoring API health and choosing strategies.

Usage

vigiar_benchmark_tabelas(tabelas = NULL, repeticoes = 2L, timeout = 120)

Arguments

tabelas

Character vector of table names. Default: main tables.

repeticoes

Number of repetitions per table.

timeout

Timeout per download.

Value

A tibble with per-table performance metrics.

Examples

# \dontrun{
vigiar_conectar()
#> Sessao VIGIAR ja esta ativa. Use refresh = TRUE para renovar.
vigiar_status()
#> Dashboard VIGIAR online. Esquema de dados consistente.
vigiar_benchmark_tabelas(c("df_anual", "df_muni"), repeticoes = 1)
#> 
#> ── Benchmark Multi-Tabela ──────────────────────────────────────────────────────
#> 
#> ── [1/2] df_anual (7 colunas) ──
#> 
#> ℹ Baixando tabela 'df_anual'...
#> ℹ Filtro UF='RJ' (UF): 0 linhas (de 1000).
#> ✔ Tabela 'df_anual' baixada: 0 linhas x 7 colunas (0.5s)
#> 
#> ── [2/2] df_muni (19 colunas) ──
#> 
#> ℹ Baixando tabela 'df_muni'...
#> ℹ Filtro UF='RJ' (UF_SIGLA): 0 linhas (de 1000).
#> ✔ Tabela 'df_muni' baixada: 0 linhas x 19 colunas (0.8s)
#> ────────────────────────────────────────────────────────────────────────────────
#> 
#> ── Resumo ──────────────────────────────────────────────────────────────────────
#> ℹ 2/2 tabelas baixadas com sucesso
#> # A tibble: 2 × 8
#>   tabela   colunas tempo_medio tempo_min tempo_max n_linhas taxa_sucesso status
#>   <chr>      <int>       <dbl>     <dbl>     <dbl>    <int>        <dbl> <chr> 
#> 1 df_anual       7       0.464     0.464     0.464        0            1 OK    
#> 2 df_muni       19       0.778     0.778     0.778        0            1 OK    
# }