Skip to content

Instantly share code, notes, and snippets.

@dakrone
Created January 12, 2011 19:10
Show Gist options
  • Select an option

  • Save dakrone/776677 to your computer and use it in GitHub Desktop.

Select an option

Save dakrone/776677 to your computer and use it in GitHub Desktop.
#!/bin/env ruby
require 'socket'
count = `curl -s "http://localhost:9200/_count?q=*:*" | cut -d : -f 2 | cut -d , -f 1`.chomp
hostname = 'ec2-50-16-13-174.compute-1.amazonaws.com'
port = 2003
s = TCPSocket.open(hostname, port)
s.print "elasticsearch.count #{count} #{Time.now.to_i}\n"
s.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment