data-transfer-test/init.rb
2020-06-02 23:02:01 -04:00

14 lines
233 B
Ruby

require 'speedtest'
require 'sinatra/activerecord'
require './models/rate'
test = Speedtest::Test.new(debug: false)
result = test.run
Rate.create({
download: result.pretty_download_rate,
upload: result.pretty_upload_rate,
})