@ -1,31 +1,4 @@ |
|||
language: r |
|||
|
|||
warnings_are_errors: true |
|||
|
|||
sudo: required |
|||
|
|||
language: R |
|||
cache: packages |
|||
|
|||
r: |
|||
- oldrel |
|||
- release |
|||
- devel |
|||
|
|||
apt_packages: |
|||
- libv8-dev |
|||
- xclip |
|||
|
|||
env: |
|||
global: |
|||
- CRAN: http://cran.rstudio.com |
|||
|
|||
after_success: |
|||
- Rscript -e 'covr::codecov()' |
|||
|
|||
notifications: |
|||
email: |
|||
- bob@rud.is |
|||
irc: |
|||
channels: |
|||
- "104.236.112.222#builds" |
|||
nick: travisci |
|||
- Rscript -e 'covr::codecov()' |
@ -1,40 +1,31 @@ |
|||
Package: speedtest |
|||
Type: Package |
|||
Title: Tools to Test and Compare Internet Bandwidth Speeds |
|||
Version: 0.1.0 |
|||
Date: 2017-11-09 |
|||
Authors@R: c( |
|||
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), |
|||
comment = c(ORCID = "0000-0001-5670-2640")), |
|||
person("Bryce", "Mecum", email = "petridish@gmail.com", role = "ctb", |
|||
comment = c(ORCID = "0000-0002-0381-3766")), |
|||
person("Garrett", "Mooney", email = "gmooney@mail.bradley.edu", role = "ctb") |
|||
) |
|||
Author: Bob Rudis (bob@rud.is) |
|||
Version: 0.2.0 |
|||
Date: 2019-07-24 |
|||
Authors@R: c( person("Bob", "Rudis", email = "bob@rud.is", |
|||
role = c("aut", "cre"), comment = c(ORCID = |
|||
"0000-0001-5670-2640")), person("Bryce", "Mecum", |
|||
email = "petridish@gmail.com", role = "ctb", comment |
|||
= c(ORCID = "0000-0002-0381-3766")), |
|||
person("Garrett", "Mooney", email = |
|||
"gmooney@mail.bradley.edu", role = "ctb") ) |
|||
Maintainer: Bob Rudis <bob@rud.is> |
|||
Description: The 'Ookla' 'Speedtest' site <http://beta.speedtest.net/about> provides |
|||
interactive and programmatic services to test and compare bandwidth speeds from |
|||
a source node on the Internet to thousands of test servers. Tools are provided |
|||
to obtain test server lists, identify target servers for testing and performing |
|||
speed/bandwidth tests. |
|||
URL: https://github.com/hrbrmstr/speedtest |
|||
BugReports: https://github.com/hrbrmstr/speedtest/issues |
|||
License: AGPL |
|||
Suggests: |
|||
testthat, |
|||
covr |
|||
Depends: |
|||
R (>= 3.2.0) |
|||
Description: The 'Ookla' 'Speedtest' site |
|||
<http://beta.speedtest.net/about> provides |
|||
interactive and programmatic services to test and |
|||
compare bandwidth speeds from a source node on the |
|||
Internet to thousands of test servers. Tools are |
|||
provided to obtain test server lists, identify target |
|||
servers for testing and performing speed/bandwidth |
|||
tests. |
|||
URL: https://gitlab.com/hrbrmstr/speedtest |
|||
BugReports: https://gitlab.com/hrbrmstr/speedtest/issues |
|||
License: MIT + file LICENSE |
|||
Suggests: covr, tinytest |
|||
Depends: R (>= 3.2.0) |
|||
Encoding: UTF-8 |
|||
Imports: |
|||
curl, |
|||
purrr, |
|||
dplyr, |
|||
xml2, |
|||
utils, |
|||
pingr, |
|||
urltools, |
|||
jsonlite, |
|||
crayon, |
|||
cli |
|||
RoxygenNote: 6.0.1 |
|||
Imports: httr, stats, curl, purrr, dplyr, xml2, utils, |
|||
pingr, urltools, jsonlite, crayon, tibble, cli, |
|||
magrittr |
|||
RoxygenNote: 6.1.1 |
|||
|
@ -0,0 +1,2 @@ |
|||
YEAR: 2019 |
|||
COPYRIGHT HOLDER: Bob Rudis |
@ -0,0 +1,21 @@ |
|||
# MIT License |
|||
|
|||
Copyright (c) 2019 Bob Rudis |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
of this software and associated documentation files (the "Software"), to deal |
|||
in the Software without restriction, including without limitation the rights |
|||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
copies of the Software, and to permit persons to whom the Software is |
|||
furnished to do so, subject to the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be included in all |
|||
copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|||
SOFTWARE. |
@ -1,2 +1,9 @@ |
|||
0.2.0 |
|||
* Updated pkg infrastructure (non-salient to operations) |
|||
* Now passes CRAN checks |
|||
* Updated user agent |
|||
* Ensured primary URLs for speedtest resources are HTTPS |
|||
* Swiched to {tinytest} |
|||
|
|||
0.1.0 |
|||
* Initial release |
|||
|
@ -1,7 +1,13 @@ |
|||
.base_raw <- charToRaw('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ') |
|||
|
|||
.speedtest_ua <- "Mozilla/5.0 (Compatibe; r-speedtest/1.0; https://github.com/hrbrmstr/speedtest)" |
|||
.speedtest_ua <- "Mozilla/5.0 (Compatible; r-speedtest/1.0; https://gitlab.com/hrbrmstr/speedtest)" |
|||
|
|||
utils::globalVariables( |
|||
c("total", "latency_url", "test_result", "ping_time", "total_time", "retrieval_time", |
|||
"bw", "size", "secs")) |
|||
c( |
|||
"total", "latency_url", "test_result", "ping_time", "total_time", |
|||
"retrieval_time", "bw", "size", "secs", "id" |
|||
) |
|||
) |
|||
|
|||
sGET <- purrr::safely(httr::GET) |
|||
sPOST <- purrr::safely(httr::POST) |
|||
|
@ -0,0 +1,11 @@ |
|||
#' Pipe operator |
|||
#' |
|||
#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. |
|||
#' |
|||
#' @name %>% |
|||
#' @rdname pipe |
|||
#' @keywords internal |
|||
#' @export |
|||
#' @importFrom magrittr %>% |
|||
#' @usage lhs \%>\% rhs |
|||
NULL |
@ -1,312 +0,0 @@ |
|||
speedtest |
|||
================ |
|||
|
|||
Tools to Test and Compare Internet Bandwidth Speeds |
|||
|
|||
## Description |
|||
|
|||
The ‘Ookla’ ‘Speedtest’ site <http://beta.speedtest.net/about> provides |
|||
interactive and programmatic services to test and compare bandwidth |
|||
speeds from a source node on the Internet to thousands of test servers. |
|||
Tools are provided to obtain test server lists, identify target servers |
|||
for testing and performing speed/bandwidth tests. |
|||
|
|||
## What’s Inside The Tin |
|||
|
|||
The following functions are implemented: |
|||
|
|||
- `spd_best_servers`: Find “best” servers (latency-wise) from master |
|||
server list |
|||
- `spd_closest_servers`: Find “closest” servers (geography-wise) from |
|||
master server list |
|||
- `spd_compute_bandwidth`: Compute bandwidth from bytes transferred |
|||
and time taken |
|||
- `spd_config`: Retrieve client configuration information for the |
|||
speedtest |
|||
- `spd_download_test`: Perform a download speed/bandwidth test |
|||
- `spd_servers`: Retrieve a list of SpeedTest servers |
|||
- `spd_upload_test`: Perform an upload speed/bandwidth test |
|||
- `spd_test`: Test your internet speed/bandwidth |
|||
|
|||
## Make a CLI utility |
|||
|
|||
While you can run `spd_test()` from an R console, it was desgined to be |
|||
an easily wrapped into a `bash` (et al) alias or put into a small batch |
|||
script. Or, you can just type out the following if you’re |
|||
fleet-of-finger/have dexterous digits: |
|||
|
|||
Rscript --quiet -e 'speedtest::spd_test()' |
|||
|
|||
which will look something like: |
|||
|
|||
![](imgs/spdtst.gif) |
|||
|
|||
## TODO |
|||
|
|||
Folks interested in contributing can take a look at the TODOs and pick |
|||
as many as you like\! Ones with question marks are truly a “I dunno if |
|||
we shld” kinda thing. Ones with exclamation marks are essentials. |
|||
|
|||
- \[ \] Cache config in memory at startup vs pass around to functions? |
|||
- \[ \] Figure out how to use beta sockets hidden API vs the old Flash |
|||
API? |
|||
- \[ \] Ensure the efficacy of relying on the cURL timings for speed |
|||
measures for the Flash API |
|||
- \[ \] Figure out best way to capture the results for post-processing |
|||
- \[ \] Upload results to speedtest (tis only fair)\! |
|||
- \[ \] Incorporate more network or host measures for better |
|||
statistical determination of the best target\! |
|||
- \[ \] `autoplot` support\! |
|||
- \[ \] RStudio Add-in |
|||
- \[ \] Shiny app? |
|||
|
|||
## Installation |
|||
|
|||
``` r |
|||
devtools::install_github("hrbrmstr/speedtest") |
|||
``` |
|||
|
|||
``` r |
|||
options(width=120) |
|||
``` |
|||
|
|||
## Usage |
|||
|
|||
``` r |
|||
library(speedtest) |
|||
library(stringi) |
|||
library(hrbrthemes) |
|||
library(ggbeeswarm) |
|||
library(tidyverse) |
|||
|
|||
# current verison |
|||
packageVersion("speedtest") |
|||
``` |
|||
|
|||
## [1] '0.1.0' |
|||
|
|||
### Download Speed |
|||
|
|||
``` r |
|||
config <- spd_config() |
|||
|
|||
servers <- spd_servers(config=config) |
|||
closest_servers <- spd_closest_servers(servers, config=config) |
|||
only_the_best_severs <- spd_best_servers(closest_servers, config) |
|||
``` |
|||
|
|||
### Individual download tests |
|||
|
|||
``` r |
|||
glimpse(spd_download_test(closest_servers[1,], config=config)) |
|||
``` |
|||
|
|||
## Observations: 1 |
|||
## Variables: 15 |
|||
## $ url <chr> "http://speed0.xcelx.net/speedtest/upload.php" |
|||
## $ lat <dbl> 42.3875 |
|||
## $ lng <dbl> -71.1 |
|||
## $ name <chr> "Somerville, MA" |
|||
## $ country <chr> "United States" |
|||
## $ cc <chr> "US" |
|||
## $ sponsor <chr> "Axcelx Technologies LLC" |
|||
## $ id <chr> "5960" |
|||
## $ host <chr> "speed0.xcelx.net:8080" |
|||
## $ url2 <chr> "http://speed1.xcelx.net/speedtest/upload.php" |
|||
## $ min <dbl> 13.24172 |
|||
## $ mean <dbl> 54.31822 |
|||
## $ median <dbl> 52.28935 |
|||
## $ max <dbl> 83.77728 |
|||
## $ sd <dbl> 26.88115 |
|||
|
|||
``` r |
|||
glimpse(spd_download_test(only_the_best_severs[1,], config=config)) |
|||
``` |
|||
|
|||
## Observations: 1 |
|||
## Variables: 18 |
|||
## $ ping_time <dbl> NaN |
|||
## $ total_time <dbl> 0.100793 |
|||
## $ retrieval_time <dbl> 2.3e-05 |
|||
## $ url <chr> "http://stosat-ndhm-01.sys.comcast.net/speedtest/upload.php" |
|||
## $ lat <dbl> 42.3578 |
|||
## $ lng <dbl> -71.0617 |
|||
## $ name <chr> "Boston, MA" |
|||
## $ country <chr> "United States" |
|||
## $ cc <chr> "US" |
|||
## $ sponsor <chr> "Comcast" |
|||
## $ id <chr> "1774" |
|||
## $ host <chr> "stosat-ndhm-01.sys.comcast.net:8080" |
|||
## $ url2 <chr> "http://a-stosat-ndhm-01.sys.comcast.net/speedtest/upload.php" |
|||
## $ min <dbl> 13.7987 |
|||
## $ mean <dbl> 73.27741 |
|||
## $ median <dbl> 78.4501 |
|||
## $ max <dbl> 138.8271 |
|||
## $ sd <dbl> 44.21786 |
|||
|
|||
### Individual upload tests |
|||
|
|||
``` r |
|||
glimpse(spd_upload_test(only_the_best_severs[1,], config=config)) |
|||
``` |
|||
|
|||
## Observations: 1 |
|||
## Variables: 18 |
|||
## $ ping_time <dbl> NaN |
|||
## $ total_time <dbl> 0.100793 |
|||
## $ retrieval_time <dbl> 2.3e-05 |
|||
## $ url <chr> "http://stosat-ndhm-01.sys.comcast.net/speedtest/upload.php" |
|||
## $ lat <dbl> 42.3578 |
|||
## $ lng <dbl> -71.0617 |
|||
## $ name <chr> "Boston, MA" |
|||
## $ country <chr> "United States" |
|||
## $ cc <chr> "US" |
|||
## $ sponsor <chr> "Comcast" |
|||
## $ id <chr> "1774" |
|||
## $ host <chr> "stosat-ndhm-01.sys.comcast.net:8080" |
|||
## $ url2 <chr> "http://a-stosat-ndhm-01.sys.comcast.net/speedtest/upload.php" |
|||
## $ min <dbl> 3.868808 |
|||
## $ mean <dbl> 6.25797 |
|||
## $ median <dbl> 6.165482 |
|||
## $ max <dbl> 8.921862 |
|||
## $ sd <dbl> 1.796898 |
|||
|
|||
``` r |
|||
glimpse(spd_upload_test(closest_servers[1,], config=config)) |
|||
``` |
|||
|
|||
## Observations: 1 |
|||
## Variables: 15 |
|||
## $ url <chr> "http://speed0.xcelx.net/speedtest/upload.php" |
|||
## $ lat <dbl> 42.3875 |
|||
## $ lng <dbl> -71.1 |
|||
## $ name <chr> "Somerville, MA" |
|||
## $ country <chr> "United States" |
|||
## $ cc <chr> "US" |
|||
## $ sponsor <chr> "Axcelx Technologies LLC" |
|||
## $ id <chr> "5960" |
|||
## $ host <chr> "speed0.xcelx.net:8080" |
|||
## $ url2 <chr> "http://speed1.xcelx.net/speedtest/upload.php" |
|||
## $ min <dbl> 3.554852 |
|||
## $ mean <dbl> 9.124757 |
|||
## $ median <dbl> 10.5464 |
|||
## $ max <dbl> 11.94891 |
|||
## $ sd <dbl> 3.464799 |
|||
|
|||
### Moar download tests |
|||
|
|||
Choose closest, “best” and randomly (there can be, and are, some dups as |
|||
a result for best/closest), run the test and chart the results. This |
|||
will show just how disparate the results are from these core/crude |
|||
tests. Most of the test servers compensate when they present the |
|||
results. Newer, “socket”-based tests are more accurate but there are no |
|||
free/hidden exposed APIs yet for most of them. |
|||
|
|||
``` r |
|||
set.seed(8675309) |
|||
|
|||
bind_rows( |
|||
|
|||
closest_servers[1:3,] %>% |
|||
mutate(type="closest"), |
|||
|
|||
only_the_best_severs[1:3,] %>% |
|||
mutate(type="best"), |
|||
|
|||
filter(servers, !(id %in% c(closest_servers[1:3,]$id, only_the_best_severs[1:3,]$id))) %>% |
|||
sample_n(3) %>% |
|||
mutate(type="random") |
|||
|
|||
) %>% |
|||
group_by(type) %>% |
|||
ungroup() -> to_compare |
|||
|
|||
select(to_compare, sponsor, name, country, host, type) |
|||
``` |
|||
|
|||
## # A tibble: 9 x 5 |
|||
## sponsor name country host type |
|||
## <chr> <chr> <chr> <chr> <chr> |
|||
## 1 Axcelx Technologies LLC Somerville, MA United States speed0.xcelx.net:8080 closest |
|||
## 2 Comcast Boston, MA United States stosat-ndhm-01.sys.comcast.net:8080 closest |
|||
## 3 Starry, Inc. Boston, MA United States speedtest-server.starry.com:8080 closest |
|||
## 4 Comcast Boston, MA United States stosat-ndhm-01.sys.comcast.net:8080 best |
|||
## 5 Axcelx Technologies LLC Somerville, MA United States speed0.xcelx.net:8080 best |
|||
## 6 Norwood Light Broadband Norwood, MA United States speedtest.norwoodlight.com:8080 best |
|||
## 7 Rudzkie Sieci Komputerowe Ruda Śląska Poland sp1.rsknet.pl:8080 random |
|||
## 8 AT&T Los Angeles, CA United States lax.speedtest.sbcglobal.net:8080 random |
|||
## 9 UP Telecom Lucena Brazil sp1.bandalargaup.com.br:8080 random |
|||
|
|||
``` r |
|||
map_df(1:nrow(to_compare), ~{ |
|||
spd_download_test(to_compare[.x,], config=config, summarise=FALSE, timeout=30) |
|||
}) -> dl_results_full |
|||
``` |
|||
|
|||
``` r |
|||
mutate(dl_results_full, type=stri_trans_totitle(type)) %>% |
|||
ggplot(aes(type, bw, fill=type)) + |
|||
geom_quasirandom(aes(size=size, color=type), width=0.15, shape=21, stroke=0.25) + |
|||
scale_y_continuous(expand=c(0,5), labels=c(sprintf("%s", seq(0,150,50)), "200 Mb/s"), limits=c(0,200)) + |
|||
scale_size(range=c(2,6)) + |
|||
scale_color_manual(values=c(Random="#b2b2b2", Best="#2b2b2b", Closest="#2b2b2b")) + |
|||
scale_fill_ipsum() + |
|||
labs(x=NULL, y=NULL, title="Download bandwidth test by selected server type", |
|||
subtitle="Circle size scaled by size of file used in that speed test") + |
|||
theme_ipsum_rc(grid="Y") + |
|||
theme(legend.position="none") |
|||
``` |
|||
|
|||
<img src="README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-10-1.png" width="672" /> |
|||
|
|||
### Moar upload tests |
|||
|
|||
Choose closest and “best” and filter duplicates out since we’re really |
|||
trying to measure here vs show the disparity: |
|||
|
|||
``` r |
|||
bind_rows( |
|||
closest_servers[1:3,] %>% mutate(type="closest"), |
|||
only_the_best_severs[1:3,] %>% mutate(type="best") |
|||
) %>% |
|||
distinct(.keep_all=TRUE) -> to_compare |
|||
|
|||
select(to_compare, sponsor, name, country, host, type) |
|||
``` |
|||
|
|||
## # A tibble: 6 x 5 |
|||
## sponsor name country host type |
|||
## <chr> <chr> <chr> <chr> <chr> |
|||
## 1 Axcelx Technologies LLC Somerville, MA United States speed0.xcelx.net:8080 closest |
|||
## 2 Comcast Boston, MA United States stosat-ndhm-01.sys.comcast.net:8080 closest |
|||
## 3 Starry, Inc. Boston, MA United States speedtest-server.starry.com:8080 closest |
|||
## 4 Comcast Boston, MA United States stosat-ndhm-01.sys.comcast.net:8080 best |
|||
## 5 Axcelx Technologies LLC Somerville, MA United States speed0.xcelx.net:8080 best |
|||
## 6 Norwood Light Broadband Norwood, MA United States speedtest.norwoodlight.com:8080 best |
|||
|
|||
``` r |
|||
map_df(1:nrow(to_compare), ~{ |
|||
spd_upload_test(to_compare[.x,], config=config, summarise=FALSE, timeout=30) |
|||
}) -> ul_results_full |
|||
``` |
|||
|
|||
``` r |
|||
ggplot(ul_results_full, aes(x="Upload Test", y=bw)) + |
|||
geom_quasirandom(aes(size=size, fill="col"), width=0.1, shape=21, stroke=0.25, color="#2b2b2b") + |
|||
scale_y_continuous(expand=c(0,0.5), breaks=seq(0,16,4), |
|||
labels=c(sprintf("%s", seq(0,12,4)), "16 Mb/s"), limits=c(0,16)) + |
|||
scale_size(range=c(2,6)) + |
|||
scale_fill_ipsum() + |
|||
labs(x=NULL, y=NULL, title="Upload bandwidth test by selected server type", |
|||
subtitle="Circle size scaled by size of file used in that speed test") + |
|||
theme_ipsum_rc(grid="Y") + |
|||
theme(legend.position="none") |
|||
``` |
|||
|
|||
<img src="README.gfm-ascii_identifiers_files/figure-gfm/unnamed-chunk-12-1.png" width="672" /> |
|||
|
|||
## Code of Conduct |
|||
|
|||
Please note that this project is released with a [Contributor Code of |
|||
Conduct](CONDUCT.md). By participating in this project you agree to |
|||
abide by its terms. |
Before Width: | Height: | Size: 113 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 48 KiB |
@ -0,0 +1,45 @@ |
|||
# DO NOT CHANGE the "init" and "install" sections below |
|||
|
|||
# Download script file from GitHub |
|||
init: |
|||
ps: | |
|||
$ErrorActionPreference = "Stop" |
|||
Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" |
|||
Import-Module '..\appveyor-tool.ps1' |
|||
|
|||
install: |
|||
ps: Bootstrap |
|||
|
|||
cache: |
|||
- C:\RLibrary |
|||
|
|||
# Adapt as necessary starting from here |
|||
|
|||
build_script: |
|||
- travis-tool.sh install_deps |
|||
|
|||
test_script: |
|||
- travis-tool.sh run_tests |
|||
|
|||
on_failure: |
|||
- 7z a failure.zip *.Rcheck\* |
|||
- appveyor PushArtifact failure.zip |
|||
|
|||
artifacts: |
|||
- path: '*.Rcheck\**\*.log' |
|||
name: Logs |
|||
|
|||
- path: '*.Rcheck\**\*.out' |
|||
name: Logs |
|||
|
|||
- path: '*.Rcheck\**\*.fail' |
|||
name: Logs |
|||
|
|||
- path: '*.Rcheck\**\*.Rout' |
|||
name: Logs |
|||
|
|||
- path: '\*_*.tar.gz' |
|||
name: Bits |
|||
|
|||
- path: '\*_*.zip' |
|||
name: Bits |
@ -0,0 +1,8 @@ |
|||
library(speedtest) |
|||
|
|||
# speeds are displayed in appropriate units |
|||
expect_true(grepl("Kbit/s", nice_speed(0.1))) |
|||
expect_true(grepl("Mbit/s", nice_speed(1))) |
|||
expect_true(grepl("Gbit/s", nice_speed(1000))) |
|||
|
|||
expect_true(all(c("client", "odometer") %in% names(spd_config()))) |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
@ -0,0 +1,19 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/util.r |
|||
\name{nice_speed} |
|||
\alias{nice_speed} |
|||
\title{Convert a test speed, in Mbits/s, to its string representation along with |
|||
appropriate units for the magnitude of the test speed} |
|||
\usage{ |
|||
nice_speed(number) |
|||
} |
|||
\arguments{ |
|||
\item{number}{numeric The speed to be converted} |
|||
} |
|||
\value{ |
|||
character The character representation of the speed |
|||
} |
|||
\description{ |
|||
- Assumes number is in Mbits/s to start off with |
|||
- Only chooses between Kbit/s, Mbit/s, and Gbit/s |
|||
} |
@ -0,0 +1,12 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/utils-pipe.R |
|||
\name{\%>\%} |
|||
\alias{\%>\%} |
|||
\title{Pipe operator} |
|||
\usage{ |
|||
lhs \%>\% rhs |
|||
} |
|||
\description{ |
|||
See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. |
|||
} |
|||
\keyword{internal} |
@ -1,2 +0,0 @@ |
|||
library(testthat) |
|||
test_check("speedtest") |
@ -1,12 +0,0 @@ |
|||
context("basic functionality") |
|||
test_that("we can do something", { |
|||
|
|||
#expect_that(some_function(), is_a("data.frame")) |
|||
|
|||
}) |
|||
|
|||
test_that("speeds are displayed in appropriate units", { |
|||
expect_match(nice_speed(0.1), "Kbit/s") |
|||
expect_match(nice_speed(1), "Mbit/s") |
|||
expect_match(nice_speed(1000), "Gbit/s") |
|||
}) |
@ -0,0 +1,5 @@ |
|||
|
|||
if ( requireNamespace("tinytest", quietly=TRUE) ){ |
|||
tinytest::test_package("speedtest") |
|||
} |
|||
|