Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

lets estrus configure a host and port

  • Loading branch information...
commit fd5288599822f31f9d3ebdc038850a3808547666 1 parent 20dab1f
Philip (flip) Kromer authored
Showing with 22 additions and 5 deletions.
  1. +16 −0 README-read_tuning.textile
  2. +6 −5 ruby/estrus.rb
View
16 README-read_tuning.textile
@@ -39,3 +39,19 @@ http true:
915 /mnt/elasticsearch/data/hoolock/nodes/0/indices/tweet-201009/1/index
1908 /mnt/elasticsearch/data/hoolock/nodes/0/indices/tweet-201010/13/index
2026 /mnt/elasticsearch/data/hoolock/nodes/0/indices/tweet-201011/7/index
+
+
+ "tweet-201010" : "num_docs" : 40272985,
+ "tweet-201011" : "num_docs" : 39012255,
+ "tweet-2009q4" : "num_docs" : 577762139,
+ "tweet-201006" : "num_docs" : 288445236,
+ "tweet-201008" : "num_docs" : 30904989,
+ "tweet-201005" : "num_docs" : 242058418,
+ "tweet-201007" : "num_docs" : 311059766,
+ "tweet-2009q3pre" : "num_docs" : 359075858,
+ "tweet-201004" : "num_docs" : 190501768,
+ "tweet-201009" : "num_docs" : 19166922,
+ "tweet-2010q1" : "num_docs" : 368031331,
+
+
+
View
11 ruby/estrus.rb
@@ -4,7 +4,7 @@
require 'rubberband'
require 'fileutils'
require 'configliere'
-Settings.use :commandline
+Settings.use :commandline, :env_var
#
# Estrus -- an alluringly primitive Elasticsearch stress-testing tool
@@ -27,14 +27,15 @@
Settings.define :offset_start, :default => 50_000, :description => "Where to start reading words", :type => Integer
Settings.define :offset_scale, :default => 100, :description => "How far in the file to range", :type => Integer
Settings.define :queries, :default => 10, :description => "Number of queries to run", :type => Integer
-Settings.define :es_indexes, :default => 'tweet-2009q3pre,tweet-2009q4,tweet-201004,tweet-201005,tweet-201006', :description => "Elasticsearch index to query against", :type => Array
+Settings.define :es_indexes, :default => 'tweet-2009q3pre,tweet-2009q4,tweet-2010q1,tweet-201004,tweet-201005,tweet-201005,tweet-201006,tweet-201007,tweet-201008,tweet-201009,tweet-201010,tweet-201011', :description => "Elasticsearch index to query against", :type => Array
Settings.define :output_dir, :default => nil, :description => "If given, the output is directed to a file named :output_dir/{date}/es-{datetime}-{comment}-{hostname}.tsv"
Settings.define :comment, :default => nil, :description => "If given, it is included in the filename"
+Settings.define :host, :default => `hostname`.chomp, :description => "Host of ES query server"
+Settings.define :port, :default => '9200', :description => "Port for ES query server"
Settings.resolve!
-HOSTNAME = ENV['HOSTNAME'] || `hostname`.chomp
-NODENAME = File.read('/etc/node_name').chomp rescue HOSTNAME
-CLIENTS = Settings.es_indexes.inject([]){|clients, index| clients << [index, ElasticSearch.new("#{HOSTNAME}:9200", :index => index, :type => "tweet")] ; clients }
+NODENAME = File.read('/etc/node_name').chomp rescue `hostname`.chomp
+CLIENTS = Settings.es_indexes.inject([]){|clients, index| clients << [index, ElasticSearch.new("#{Settings.host}:#{Settings.port}", :index => index, :type => "tweet")] ; clients }
class StressTester
attr_accessor :started_at
Please sign in to comment.
Something went wrong with that request. Please try again.