Skip to content

Instantly share code, notes, and snippets.

@ciwolsey
Created November 24, 2014 23:55
Show Gist options
  • Save ciwolsey/9d3f7caac1928e38fb02 to your computer and use it in GitHub Desktop.
Save ciwolsey/9d3f7caac1928e38fb02 to your computer and use it in GitHub Desktop.
I20141124-23:53:39.420(0)? ------ PING CYCLE ----
I20141124-23:53:39.460(0)? ping
I20141124-23:53:44.366(0)? ------ PING CYCLE ----
I20141124-23:53:44.367(0)? ping
I20141124-23:53:44.589(0)? ping
I20141124-23:53:44.592(0)? pong
I20141124-23:53:44.592(0)? ping
I20141124-23:53:44.593(0)? pong
I20141124-23:53:44.822(0)? ping
I20141124-23:53:44.828(0)? pong
I20141124-23:53:44.828(0)? ping
I20141124-23:53:44.831(0)? pong
I20141124-23:53:45.062(0)? pong
I20141124-23:53:45.063(0)? pong
I20141124-23:53:49.369(0)? ------ PING CYCLE ----
I20141124-23:53:49.369(0)? ping
I20141124-23:53:54.372(0)? ------ PING CYCLE ----
I20141124-23:53:54.372(0)? ping
I20141124-23:53:54.612(0)? ping
I20141124-23:53:54.617(0)? pong
I20141124-23:53:54.619(0)? ping
I20141124-23:53:54.623(0)? pong
I20141124-23:53:54.843(0)? ping
I20141124-23:53:54.852(0)? pong
I20141124-23:53:54.853(0)? ping
I20141124-23:53:54.856(0)? pong
I20141124-23:53:55.074(0)? pong
I20141124-23:53:55.077(0)? pong
I20141124-23:53:59.378(0)? ------ PING CYCLE ----
I20141124-23:53:59.379(0)? ping
I20141124-23:53:59.754(0)? ping
I20141124-23:53:59.757(0)? pong
I20141124-23:54:00.106(0)? ping
I20141124-23:54:00.110(0)? pong
I20141124-23:54:00.498(0)? pong
I20141124-23:54:04.385(0)? ------ PING CYCLE ----
I20141124-23:54:04.386(0)? ping
I20141124-23:54:04.670(0)? ping
I20141124-23:54:04.675(0)? pong
I20141124-23:54:04.897(0)? ping
I20141124-23:54:04.907(0)? pong
I20141124-23:54:05.144(0)? pong
var Fiber = Meteor.npmRequire('fibers');
var Future = Meteor.npmRequire('fibers/future');
var ping = Meteor.npmRequire('ping');
function hostCheck(host){
console.log("ping");
var future = new Future;
ping.sys.probe(host, function(alive){
future.return(alive);
console.log("pong");
});
return future.wait();
}
Meteor.setInterval(checkTick, 5000);
function checkTick(){
console.log("------ PING CYCLE ----");
hostCheck("pingme.com");
hostCheck("pingme.com");
hostCheck("pingme.com");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment