Go to file
2021-10-07 20:39:35 -04:00
config Added and Configured gem Whenever 2021-10-07 20:32:28 -04:00
db Update Schema 2021-10-07 20:36:41 -04:00
lib/tasks Created rake task to save rate 2021-10-07 20:38:24 -04:00
models Added method to save rate in database 2021-10-07 20:39:06 -04:00
public Removed and added yarn with packs manager 2021-10-07 20:27:41 -04:00
views Atualizado readme 2020-06-04 20:59:19 -04:00
.gitignore Added Production DataBase 2021-10-07 20:33:39 -04:00
app.rb Atualizado readme 2020-06-04 20:59:19 -04:00
docker-compose.yml Added Docker-composer 2021-10-07 20:37:04 -04:00
Dockerfile Added Rack_env 2021-10-07 20:39:35 -04:00
Gemfile Created env groups 2021-10-07 20:33:12 -04:00
Gemfile.lock Created env groups 2021-10-07 20:33:12 -04:00
LICENSE Initial commit 2020-06-02 22:59:57 -04:00
Rakefile Created rake task to save rate 2021-10-07 20:38:24 -04:00
README.md Atualizado readme 2020-06-04 20:59:19 -04:00

Data Transfer Test

Data Transfer Test is a software developed to measure the amount of data transferred over a period of time.

Screen

alt

How to configure

First clone this repository to the local machine

git clone https://github.com/luizpicolo/data_transfer_test.git

After, access local respository and install the dependencies

cd data_transfer_test
bundle install

and

cd data_transfer_test/public
npm install

How to use

Add init.rb to your cronjob or just create an infinite loop so that data is collected during a pre-defined period.

init.rb

require 'speedtest'
require 'sinatra/activerecord'
require './models/rate'

test = Speedtest::Test.new(debug: false)

while true
  result = test.run
  Rate.create({
    download: result.pretty_download_rate,
    upload: result.pretty_upload_rate,
  })

  # Run every 10 minutes 
  sleep(60 * 10)
end

And, in another terminal, run the app.rb and access localhost:4567

ruby app.rb 

or

rerun 'ruby app.rb'

License

DataTransferTest use Licença MIT. For more details read the User License