Leitura dos dados brutos

ler_execucoes <- function(arquivo) {
  linhas <- readLines(arquivo, warn = FALSE)
  inicio <- grepl("Running job:", linhas, fixed = TRUE)
  fim <- grepl("Job complete", linhas, fixed = TRUE)
  job <- cumsum(inicio)
  instante <- as.POSIXct(substr(linhas, 1, 17), format = "%y/%m/%d %H:%M:%S", tz = "UTC")

  captura <- regmatches(linhas, regexec("JobClient: {4,}(.+)=([0-9]+) *$", linhas))
  valido <- lengths(captura) == 3 & job > 0

  contadores <- tibble(
    job = job[valido],
    chave = trimws(vapply(captura[valido], `[`, character(1), 2)),
    valor = as.numeric(vapply(captura[valido], `[`, character(1), 3))
  ) %>%
    distinct(job, chave, .keep_all = TRUE) %>%
    pivot_wider(names_from = chave, values_from = valor)

  anfitriao <- grep("^root@", linhas, value = TRUE)[1]
  anfitriao <- regmatches(anfitriao, regexpr("(?<=root@)[A-Za-z]+", anfitriao, perl = TRUE))
  partes <- strsplit(sub("^test-", "", basename(arquivo)), "-")[[1]]

  tibble(job = job[inicio],
         id_job = sub(".*Running job: *", "", linhas[inicio]),
         inicio = instante[inicio]) %>%
    left_join(tibble(job = job[fim], fim = instante[fim]), by = "job") %>%
    left_join(contadores, by = "job") %>%
    mutate(arquivo = basename(arquivo),
           sitio = if (length(partes) == 3) partes[1] else str_to_title(anfitriao),
           chunk_mb = as.numeric(partes[length(partes) - 1]),
           maquinas = as.numeric(partes[length(partes)]),
           .before = 1)
}

arquivos <- list.files(pattern = "^test-")
bruto <- map_dfr(arquivos, ler_execucoes)
dim(bruto)
## [1] 132  39

Medidas de leitura, escrita e tempo

dados <- bruto %>%
  filter(!is.na(fim), !is.na(`Map input bytes`)) %>%
  transmute(
    arquivo, sitio, maquinas,
    grupo = paste0(sitio, "/", maquinas, "m"),
    tempo_s = as.numeric(difftime(fim, inicio, units = "secs")),
    leitura_hdfs_gb = HDFS_BYTES_READ / 2^30,
    escrita_hdfs_gb = HDFS_BYTES_WRITTEN / 2^30,
    leitura_local_gb = FILE_BYTES_READ / 2^30,
    escrita_local_gb = FILE_BYTES_WRITTEN / 2^30,
    lido_gb = `Bytes Read` / 2^30,
    gravado_gb = `Bytes Written` / 2^30,
    shuffle_gb = `Reduce shuffle bytes` / 2^30,
    tarefas_map = `Launched map tasks`,
    tarefas_reduce = `Launched reduce tasks`,
    prop_local = `Data-local map tasks` / `Launched map tasks`,
    prop_remota = `Rack-local map tasks` / `Launched map tasks`,
    map_entrada = `Map input records`,
    map_saida = `Map output records`,
    reduce_entrada = `Reduce input records`,
    reduce_saida = `Reduce output records`,
    cpu_s = `CPU time spent (ms)` / 1000,
    heap_gb = `Total committed heap usage (bytes)` / 2^30,
    mem_fisica_gb = `Physical memory (bytes) snapshot` / 2^30,
    mem_virtual_gb = `Virtual memory (bytes) snapshot` / 2^30
  ) %>%
  mutate(
    leitura_total_gb = leitura_hdfs_gb + leitura_local_gb,
    escrita_total_gb = escrita_hdfs_gb + escrita_local_gb,
    vazao_leitura_mb_s = leitura_total_gb * 1024 / tempo_s,
    vazao_escrita_mb_s = escrita_total_gb * 1024 / tempo_s,
    cpu_por_maquina_s = cpu_s / maquinas,
    ocupacao_cpu = cpu_s / (tempo_s * maquinas)
  )

glimpse(dados)
## Rows: 132
## Columns: 30
## $ arquivo            <chr> "test-64-137", "test-64-137", "test-64-137", "test-…
## $ sitio              <chr> "Hercule", "Hercule", "Hercule", "Hercule", "Hercul…
## $ maquinas           <dbl> 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 2…
## $ grupo              <chr> "Hercule/137m", "Hercule/137m", "Hercule/137m", "He…
## $ tempo_s            <dbl> 58, 45, 41, 54, 43, 40, 43, 43, 45, 43, 58, 40, 48,…
## $ leitura_hdfs_gb    <dbl> 8.788663, 8.788663, 8.788663, 8.788663, 8.788663, 8…
## $ escrita_hdfs_gb    <dbl> 0.01242968, 0.01242968, 0.01242968, 0.01242968, 0.0…
## $ leitura_local_gb   <dbl> 7.60429, 7.60429, 7.60429, 7.60429, 7.60429, 7.6042…
## $ escrita_local_gb   <dbl> 11.34158, 11.34158, 11.34158, 11.34158, 11.34158, 1…
## $ lido_gb            <dbl> 8.788649, 8.788649, 8.788649, 8.788649, 8.788649, 8…
## $ gravado_gb         <dbl> 0.01242968, 0.01242968, 0.01242968, 0.01242968, 0.0…
## $ shuffle_gb         <dbl> 3.77698, 3.77698, 3.77698, 3.77698, 3.77698, 3.7769…
## $ tarefas_map        <dbl> 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 1…
## $ tarefas_reduce     <dbl> 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,…
## $ prop_local         <dbl> 0.7304965, 0.8226950, 0.8297872, 0.7943262, 0.78723…
## $ prop_remota        <dbl> 0.2695035, 0.1773050, 0.1702128, 0.2056738, 0.21276…
## $ map_entrada        <dbl> 202546161, 202546161, 202546161, 202546161, 2025461…
## $ map_saida          <dbl> 101386184, 101386184, 101386184, 101386184, 1013861…
## $ reduce_entrada     <dbl> 101386184, 101386184, 101386184, 101386184, 1013861…
## $ reduce_saida       <dbl> 226208, 226208, 226208, 226208, 226208, 226208, 226…
## $ cpu_s              <dbl> 2264.91, 2268.25, 2270.19, 2276.75, 2284.12, 2266.8…
## $ heap_gb            <dbl> 37.54272, 37.80103, 37.75079, 37.86206, 37.91724, 3…
## $ mem_fisica_gb      <dbl> 43.62642, 44.03933, 43.87737, 43.96888, 43.88467, 4…
## $ mem_virtual_gb     <dbl> 108.8864, 108.3185, 109.0660, 108.8847, 108.7895, 1…
## $ leitura_total_gb   <dbl> 16.39295, 16.39295, 16.39295, 16.39295, 16.39295, 1…
## $ escrita_total_gb   <dbl> 11.35401, 11.35401, 11.35401, 11.35401, 11.35401, 1…
## $ vazao_leitura_mb_s <dbl> 289.4204, 373.0308, 409.4240, 310.8590, 390.3810, 4…
## $ vazao_escrita_mb_s <dbl> 200.4569, 258.3667, 283.5732, 215.3056, 270.3838, 2…
## $ cpu_por_maquina_s  <dbl> 16.532190, 16.556569, 16.570730, 16.618613, 16.6724…
## $ ocupacao_cpu       <dbl> 0.28503775, 0.36792376, 0.40416414, 0.30775210, 0.3…

Estatísticas descritivas

dados %>%
  select(tempo_s, leitura_hdfs_gb, escrita_hdfs_gb, leitura_local_gb, escrita_local_gb,
         shuffle_gb, cpu_s, prop_local, vazao_leitura_mb_s, vazao_escrita_mb_s) %>%
  summary()
##     tempo_s    leitura_hdfs_gb  escrita_hdfs_gb   leitura_local_gb
##  Min.   : 30   Min.   : 8.789   Min.   :0.01243   Min.   : 7.604  
##  1st Qu.: 41   1st Qu.: 8.789   1st Qu.:0.01243   1st Qu.: 7.604  
##  Median : 44   Median : 8.789   Median :0.01243   Median : 7.604  
##  Mean   : 52   Mean   :13.716   Mean   :0.01243   Mean   :11.866  
##  3rd Qu.: 58   3rd Qu.:17.577   3rd Qu.:0.01243   3rd Qu.:15.203  
##  Max.   :116   Max.   :35.155   Max.   :0.01243   Max.   :30.419  
##  escrita_local_gb   shuffle_gb         cpu_s        prop_local    
##  Min.   :11.34    Min.   : 3.777   Min.   :1801   Min.   :0.7163  
##  1st Qu.:11.34    1st Qu.: 3.777   1st Qu.:2268   1st Qu.:0.7801  
##  Median :11.34    Median : 3.777   Median :2422   Median :0.8058  
##  Mean   :17.70    Mean   : 5.894   Mean   :3038   Mean   :0.8160  
##  3rd Qu.:22.67    3rd Qu.: 7.554   3rd Qu.:3477   3rd Qu.:0.8466  
##  Max.   :45.36    Max.   :15.108   Max.   :7386   Max.   :0.9078  
##  vazao_leitura_mb_s vazao_escrita_mb_s
##  Min.   :202.2      Min.   :140.1     
##  1st Qu.:381.5      1st Qu.:264.2     
##  Median :476.2      Median :329.5     
##  Mean   :506.4      Mean   :350.6     
##  3rd Qu.:633.5      3rd Qu.:438.3     
##  Max.   :839.2      Max.   :580.8
resumo <- function(x) c(n = length(x), media = mean(x), dp = sd(x), min = min(x),
                        q1 = quantile(x, .25, names = FALSE), mediana = median(x),
                        q3 = quantile(x, .75, names = FALSE), max = max(x),
                        cv = sd(x) / mean(x))

dados %>%
  select(tempo_s, leitura_total_gb, escrita_total_gb, shuffle_gb, cpu_s,
         vazao_leitura_mb_s, vazao_escrita_mb_s, prop_local) %>%
  map_dfr(resumo, .id = "medida") %>%
  knitr::kable(digits = 3)
medida n media dp min q1 mediana q3 max cv
tempo_s 132 52.000 20.932 30.000 41.000 44.000 58.000 116.000 0.403
leitura_total_gb 132 25.581 14.215 16.393 16.393 16.393 32.780 65.573 0.556
escrita_total_gb 132 17.709 9.832 11.354 11.354 11.354 22.686 45.369 0.555
shuffle_gb 132 5.894 3.275 3.777 3.777 3.777 7.554 15.108 0.556
cpu_s 132 3038.016 1471.697 1801.120 2267.895 2422.340 3477.025 7386.270 0.484
vazao_leitura_mb_s 132 506.378 167.913 202.246 381.509 476.152 633.462 839.175 0.332
vazao_escrita_mb_s 132 350.575 116.136 140.078 264.239 329.533 438.281 580.773 0.331
prop_local 132 0.816 0.047 0.716 0.780 0.806 0.847 0.908 0.057
dados %>%
  group_by(grupo, maquinas) %>%
  summarise(n = n(),
            tempo_medio = mean(tempo_s), tempo_dp = sd(tempo_s),
            leitura_gb = mean(leitura_total_gb), escrita_gb = mean(escrita_total_gb),
            vazao_leitura = mean(vazao_leitura_mb_s), vazao_escrita = mean(vazao_escrita_mb_s),
            cpu_s = mean(cpu_s), prop_local = mean(prop_local), .groups = "drop") %>%
  arrange(maquinas) %>%
  knitr::kable(digits = 3)
grupo maquinas n tempo_medio tempo_dp leitura_gb escrita_gb vazao_leitura vazao_escrita cpu_s prop_local
Hercule/137m 137 10 45.500 5.817 16.393 11.354 373.695 258.827 2275.438 0.794
Lyon/141m 141 30 45.833 7.484 16.393 11.354 371.992 257.647 2422.877 0.801
Nancy/141m 141 30 40.167 16.620 16.393 11.354 464.055 321.411 1809.448 0.789
Hercule/281m 281 10 45.300 4.990 16.393 11.354 374.060 259.079 2280.591 0.765
Nancy/282m 282 30 48.033 13.176 32.780 22.686 734.169 508.101 3475.056 0.887
Hercule/562m 562 11 70.273 1.348 32.780 22.686 477.831 330.695 3995.324 0.839
Hercule/843m 843 11 105.636 4.225 65.573 45.369 636.525 440.401 7298.891 0.779
ggplot(dados, aes(reorder(grupo, maquinas), tempo_s, fill = sitio)) +
  geom_boxplot() +
  labs(x = NULL, y = "Tempo (s)", title = "Tempo de execução por conjunto de execuções") +
  theme_minimal()

dados %>%
  select(grupo, maquinas, leitura_hdfs_gb, leitura_local_gb, escrita_hdfs_gb, escrita_local_gb) %>%
  pivot_longer(-c(grupo, maquinas)) %>%
  ggplot(aes(reorder(grupo, maquinas), value, fill = name)) +
  geom_boxplot() +
  labs(x = NULL, y = "GB", fill = NULL, title = "Leitura e escrita por conjunto de execuções") +
  theme_minimal()

ggplot(dados, aes(tempo_s)) +
  geom_histogram(bins = 20, fill = "steelblue", color = "white") +
  facet_wrap(~ reorder(grupo, maquinas), scales = "free") +
  labs(x = "Tempo (s)", y = "Frequência") +
  theme_minimal()

Correlação de Pearson

medidas <- dados %>%
  select(tempo_s, maquinas, tarefas_map, leitura_hdfs_gb, escrita_hdfs_gb,
         leitura_local_gb, escrita_local_gb, shuffle_gb, map_saida, reduce_entrada,
         cpu_s, heap_gb, mem_fisica_gb, mem_virtual_gb, prop_local,
         vazao_leitura_mb_s, vazao_escrita_mb_s) %>%
  select(where(~ sd(.x) > 0))

matriz <- cor(medidas, method = "pearson")
round(matriz, 3)
##                    tempo_s maquinas tarefas_map leitura_hdfs_gb
## tempo_s              1.000    0.825       0.793           0.779
## maquinas             0.825    1.000       0.927           0.925
## tarefas_map          0.793    0.927       1.000           0.997
## leitura_hdfs_gb      0.779    0.925       0.997           1.000
## leitura_local_gb     0.779    0.925       0.997           1.000
## escrita_local_gb     0.779    0.925       0.997           1.000
## shuffle_gb           0.779    0.925       0.997           1.000
## map_saida            0.779    0.925       0.997           1.000
## reduce_entrada       0.779    0.925       0.997           1.000
## cpu_s                0.819    0.947       0.985           0.982
## heap_gb              0.772    0.918       0.996           1.000
## mem_fisica_gb        0.774    0.923       0.995           1.000
## mem_virtual_gb       0.765    0.915       0.994           0.999
## prop_local          -0.083    0.044       0.160           0.223
## vazao_leitura_mb_s  -0.039    0.360       0.529           0.567
## vazao_escrita_mb_s  -0.040    0.360       0.528           0.566
##                    leitura_local_gb escrita_local_gb shuffle_gb map_saida
## tempo_s                       0.779            0.779      0.779     0.779
## maquinas                      0.925            0.925      0.925     0.925
## tarefas_map                   0.997            0.997      0.997     0.997
## leitura_hdfs_gb               1.000            1.000      1.000     1.000
## leitura_local_gb              1.000            1.000      1.000     1.000
## escrita_local_gb              1.000            1.000      1.000     1.000
## shuffle_gb                    1.000            1.000      1.000     1.000
## map_saida                     1.000            1.000      1.000     1.000
## reduce_entrada                1.000            1.000      1.000     1.000
## cpu_s                         0.982            0.982      0.982     0.982
## heap_gb                       1.000            1.000      1.000     1.000
## mem_fisica_gb                 1.000            1.000      1.000     1.000
## mem_virtual_gb                0.999            0.999      0.999     0.999
## prop_local                    0.222            0.223      0.223     0.223
## vazao_leitura_mb_s            0.567            0.567      0.567     0.567
## vazao_escrita_mb_s            0.566            0.566      0.566     0.566
##                    reduce_entrada cpu_s heap_gb mem_fisica_gb mem_virtual_gb
## tempo_s                     0.779 0.819   0.772         0.774          0.765
## maquinas                    0.925 0.947   0.918         0.923          0.915
## tarefas_map                 0.997 0.985   0.996         0.995          0.994
## leitura_hdfs_gb             1.000 0.982   1.000         1.000          0.999
## leitura_local_gb            1.000 0.982   1.000         1.000          0.999
## escrita_local_gb            1.000 0.982   1.000         1.000          0.999
## shuffle_gb                  1.000 0.982   1.000         1.000          0.999
## map_saida                   1.000 0.982   1.000         1.000          0.999
## reduce_entrada              1.000 0.982   1.000         1.000          0.999
## cpu_s                       0.982 1.000   0.977         0.980          0.974
## heap_gb                     1.000 0.977   1.000         1.000          1.000
## mem_fisica_gb               1.000 0.980   1.000         1.000          0.999
## mem_virtual_gb              0.999 0.974   1.000         0.999          1.000
## prop_local                  0.223 0.142   0.228         0.239          0.246
## vazao_leitura_mb_s          0.567 0.458   0.579         0.577          0.591
## vazao_escrita_mb_s          0.566 0.458   0.578         0.577          0.590
##                    prop_local vazao_leitura_mb_s vazao_escrita_mb_s
## tempo_s                -0.083             -0.039             -0.040
## maquinas                0.044              0.360              0.360
## tarefas_map             0.160              0.529              0.528
## leitura_hdfs_gb         0.223              0.567              0.566
## leitura_local_gb        0.222              0.567              0.566
## escrita_local_gb        0.223              0.567              0.566
## shuffle_gb              0.223              0.567              0.566
## map_saida               0.223              0.567              0.566
## reduce_entrada          0.223              0.567              0.566
## cpu_s                   0.142              0.458              0.458
## heap_gb                 0.228              0.579              0.578
## mem_fisica_gb           0.239              0.577              0.577
## mem_virtual_gb          0.246              0.591              0.590
## prop_local              1.000              0.623              0.623
## vazao_leitura_mb_s      0.623              1.000              1.000
## vazao_escrita_mb_s      0.623              1.000              1.000
sort(round(matriz["tempo_s", ], 3), decreasing = TRUE)
##            tempo_s           maquinas              cpu_s        tarefas_map 
##              1.000              0.825              0.819              0.793 
##    leitura_hdfs_gb   leitura_local_gb   escrita_local_gb         shuffle_gb 
##              0.779              0.779              0.779              0.779 
##          map_saida     reduce_entrada      mem_fisica_gb            heap_gb 
##              0.779              0.779              0.774              0.772 
##     mem_virtual_gb vazao_leitura_mb_s vazao_escrita_mb_s         prop_local 
##              0.765             -0.039             -0.040             -0.083
as.data.frame(as.table(matriz)) %>%
  ggplot(aes(Var1, Var2, fill = Freq)) +
  geom_tile() +
  geom_text(aes(label = round(Freq, 2)), size = 2.3) +
  scale_fill_gradient2(limits = c(-1, 1), low = "firebrick", high = "steelblue") +
  labs(x = NULL, y = NULL, fill = "r", title = "Correlação de Pearson") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

pares <- tribble(
  ~x,                 ~y,
  "leitura_hdfs_gb",  "tempo_s",
  "escrita_local_gb", "tempo_s",
  "shuffle_gb",       "tempo_s",
  "cpu_s",            "tempo_s",
  "maquinas",         "tempo_s",
  "prop_local",       "tempo_s",
  "leitura_hdfs_gb",  "cpu_s",
  "leitura_hdfs_gb",  "escrita_local_gb"
)

pares %>%
  mutate(teste = map2(x, y, ~ cor.test(dados[[.x]], dados[[.y]]))) %>%
  mutate(r = map_dbl(teste, "estimate"),
         ic_inf = map_dbl(teste, ~ .x$conf.int[1]),
         ic_sup = map_dbl(teste, ~ .x$conf.int[2]),
         p_valor = map_dbl(teste, "p.value")) %>%
  select(-teste) %>%
  knitr::kable(digits = 4)
x y r ic_inf ic_sup p_valor
leitura_hdfs_gb tempo_s 0.7788 0.7013 0.8382 0.0000
escrita_local_gb tempo_s 0.7789 0.7014 0.8382 0.0000
shuffle_gb tempo_s 0.7788 0.7013 0.8382 0.0000
cpu_s tempo_s 0.8192 0.7538 0.8685 0.0000
maquinas tempo_s 0.8250 0.7615 0.8729 0.0000
prop_local tempo_s -0.0826 -0.2500 0.0895 0.3463
leitura_hdfs_gb cpu_s 0.9824 0.9753 0.9875 0.0000
leitura_hdfs_gb escrita_local_gb 1.0000 1.0000 1.0000 0.0000
ggplot(dados, aes(leitura_total_gb, tempo_s, color = grupo)) +
  geom_point(size = 2) +
  geom_smooth(method = "lm", se = FALSE, color = "black", linewidth = .5) +
  labs(x = "Leitura total (GB)", y = "Tempo (s)") +
  theme_minimal()

ggplot(dados, aes(cpu_s, tempo_s, color = grupo)) +
  geom_point(size = 2) +
  geom_smooth(method = "lm", se = FALSE, color = "black", linewidth = .5) +
  labs(x = "CPU (s)", y = "Tempo (s)") +
  theme_minimal()

Relação entre as diferentes execuções

dados %>%
  group_by(grupo) %>%
  summarise(n = n(),
            r_cpu_tempo = cor(cpu_s, tempo_s),
            r_local_tempo = cor(prop_local, tempo_s),
            r_heap_tempo = cor(heap_gb, tempo_s),
            r_memfisica_tempo = cor(mem_fisica_gb, tempo_s), .groups = "drop") %>%
  knitr::kable(digits = 3)
grupo n r_cpu_tempo r_local_tempo r_heap_tempo r_memfisica_tempo
Hercule/137m 10 -0.309 -0.643 -0.622 -0.574
Hercule/281m 10 -0.313 -0.171 0.178 -0.369
Hercule/562m 11 0.466 -0.703 -0.465 -0.219
Hercule/843m 11 0.645 0.734 -0.549 -0.228
Lyon/141m 30 -0.167 0.049 -0.064 0.020
Nancy/141m 30 0.011 -0.019 -0.251 -0.224
Nancy/282m 30 0.141 -0.362 0.001 -0.085
medias <- dados %>%
  group_by(sitio, grupo, maquinas) %>%
  summarise(across(c(tempo_s, leitura_total_gb, escrita_total_gb, shuffle_gb, cpu_s,
                     vazao_leitura_mb_s, vazao_escrita_mb_s, prop_local), mean),
            .groups = "drop")

knitr::kable(medias, digits = 3)
sitio grupo maquinas tempo_s leitura_total_gb escrita_total_gb shuffle_gb cpu_s vazao_leitura_mb_s vazao_escrita_mb_s prop_local
Hercule Hercule/137m 137 45.500 16.393 11.354 3.777 2275.438 373.695 258.827 0.794
Hercule Hercule/281m 281 45.300 16.393 11.354 3.777 2280.591 374.060 259.079 0.765
Hercule Hercule/562m 562 70.273 32.780 22.686 7.554 3995.324 477.831 330.695 0.839
Hercule Hercule/843m 843 105.636 65.573 45.369 15.108 7298.891 636.525 440.401 0.779
Lyon Lyon/141m 141 45.833 16.393 11.354 3.777 2422.877 371.992 257.647 0.801
Nancy Nancy/141m 141 40.167 16.393 11.354 3.777 1809.448 464.055 321.411 0.789
Nancy Nancy/282m 282 48.033 32.780 22.686 7.554 3475.056 734.169 508.101 0.887
round(cor(select(medias, where(is.numeric)), method = "pearson"), 3)
##                    maquinas tempo_s leitura_total_gb escrita_total_gb
## maquinas              1.000   0.970            0.934            0.934
## tempo_s               0.970   1.000            0.952            0.952
## leitura_total_gb      0.934   0.952            1.000            1.000
## escrita_total_gb      0.934   0.952            1.000            1.000
## shuffle_gb            0.934   0.952            1.000            1.000
## cpu_s                 0.951   0.977            0.991            0.991
## vazao_leitura_mb_s    0.505   0.458            0.701            0.701
## vazao_escrita_mb_s    0.504   0.458            0.701            0.701
## prop_local           -0.023  -0.107            0.090            0.090
##                    shuffle_gb cpu_s vazao_leitura_mb_s vazao_escrita_mb_s
## maquinas                0.934 0.951              0.505              0.504
## tempo_s                 0.952 0.977              0.458              0.458
## leitura_total_gb        1.000 0.991              0.701              0.701
## escrita_total_gb        1.000 0.991              0.701              0.701
## shuffle_gb              1.000 0.991              0.701              0.701
## cpu_s                   0.991 1.000              0.614              0.614
## vazao_leitura_mb_s      0.701 0.614              1.000              1.000
## vazao_escrita_mb_s      0.701 0.614              1.000              1.000
## prop_local              0.090 0.028              0.630              0.630
##                    prop_local
## maquinas               -0.023
## tempo_s                -0.107
## leitura_total_gb        0.090
## escrita_total_gb        0.090
## shuffle_gb              0.090
## cpu_s                   0.028
## vazao_leitura_mb_s      0.630
## vazao_escrita_mb_s      0.630
## prop_local              1.000
aov(tempo_s ~ grupo, data = dados) %>% summary()
##              Df Sum Sq Mean Sq F value Pr(>F)    
## grupo         6  42003    7001   56.84 <2e-16 ***
## Residuals   125  15395     123                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
pairwise.t.test(dados$tempo_s, dados$grupo, p.adjust.method = "bonferroni")
## 
##  Pairwise comparisons using t tests with pooled SD 
## 
## data:  dados$tempo_s and dados$grupo 
## 
##              Hercule/137m Hercule/281m Hercule/562m Hercule/843m Lyon/141m
## Hercule/281m 1.00         -            -            -            -        
## Hercule/562m 2.5e-05      2.1e-05      -            -            -        
## Hercule/843m < 2e-16      < 2e-16      2.5e-10      -            -        
## Lyon/141m    1.00         1.00         1.3e-07      < 2e-16      -        
## Nancy/141m   1.00         1.00         7.7e-11      < 2e-16      1.00     
## Nancy/282m   1.00         1.00         1.8e-06      < 2e-16      1.00     
##              Nancy/141m
## Hercule/281m -         
## Hercule/562m -         
## Hercule/843m -         
## Lyon/141m    -         
## Nancy/141m   -         
## Nancy/282m   0.15      
## 
## P value adjustment method: bonferroni
modelo <- lm(tempo_s ~ leitura_total_gb + maquinas + prop_local, data = dados)
summary(modelo)
## 
## Call:
## lm(formula = tempo_s ~ leitura_total_gb + maquinas + prop_local, 
##     data = dados)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -16.806  -8.201  -0.765   2.914  41.480 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       90.60786   19.09947   4.744 5.51e-06 ***
## leitura_total_gb   0.49466    0.21124   2.342 0.020742 *  
## maquinas           0.05230    0.01402   3.730 0.000286 ***
## prop_local       -80.57035   24.33845  -3.310 0.001211 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.45 on 128 degrees of freedom
## Multiple R-squared:  0.7074, Adjusted R-squared:  0.7006 
## F-statistic: 103.2 on 3 and 128 DF,  p-value: < 2.2e-16
ggplot(medias, aes(maquinas, vazao_leitura_mb_s, color = sitio)) +
  geom_point(size = 3) + geom_line() +
  labs(x = "Máquinas", y = "Vazão de leitura (MB/s)") +
  theme_minimal()