GithubHelp home page GithubHelp logo

orta / ping Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zunda/ping

0.0 3.0 0.0 155 KB

A Heroku app to measure latency from client to the server

License: MIT License

Ruby 69.79% JavaScript 2.55% HTML 24.27% CoffeeScript 0.74% CSS 2.66%

ping's Introduction

ping

A Heroku app to measure latency from client to the server

Build Status

Usage

Deploy and open the top page of the app.

Via Heroku button

Deploy

Click the Deloy to Heroku button, then migrate the database, and scale the worker:

$ heroku run rake db:migrate
$ heroku ps:scale worker=1

Schedule a task, say hourly, on Heroku Scheduler to sweep database for delayed execution of geocoding locations and measuring distances

rake locations:geocode ping_results:measure_distance

Via CLI

Alternatively, create an app on Heroku (or somewhere else), push, and provision add-ons:

$ heroku create <app-name>
$ heroku addons:create heroku-postgresql
$ heroku addons:create heroku-redis
$ heroku addons:create scheduler
$ git push heroku master

Migrate the database, and scale - one or more web and worker are needed:

$ heroku run rake db:migrate
$ heroku ps:scale web=1 worker=1

Schedule a task, say hourly, on Heroku Scheduler to sweep database for delayed execution of geocoding locations and measuring distances

rake locations:geocode ping_results:measure_distance

Debugging

Set APP_STATUS config var to staging for database access through the app.

Measurement

This program measures time needed to receive response for a HEAD request to one of its static assets. See the Javascript code for details.

The time measured shuold be for a round trip of packets between the client and the server. A tcpudmp shows something like below for each ping.

08:11:30.340923 IP misoan.51404 > ec2-54-243-156-39.compute-1.amazonaws.com.http: Flags [P.], seq 2347:3100, ack 2835, win 296, length 753
08:11:30.477844 IP ec2-54-243-156-39.compute-1.amazonaws.com.http > misoan.51404: Flags [P.], seq 2835:3052, ack 3100, win 96, length 217
08:11:30.477929 IP misoan.51404 > ec2-54-243-156-39.compute-1.amazonaws.com.http: Flags [.], ack 3052, win 314, length 0

Samples

Other settings

Verification with loader.io

heroku config:set LOADERIO_VERIFICATION_TOKEN=loaderio-0123456789abcdef
heroku config:set LOADERIO_VERIFICATION_FILENAME=loaderio-0123456789abcdef

ping's People

Contributors

zunda avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.