Permalink
Browse files

builds more of curl command in build_curlo_command_string

  • Loading branch information...
1 parent a8590f1 commit c4c66013f4465fd000274359674efbf2067e7123 Missy committed May 2, 2013
Showing with 6 additions and 5 deletions.
  1. +6 −5 squirrel/replay.rb
View
@@ -152,12 +152,13 @@ def output(query, data, malformed=false)
end
end
- def build_curl_command_string(data)
- base_uri = "#{@host}:#{@port}/#{data['index']}/_search/"
+ def build_curl_command_string(query, data)
+ base_uri = "''#{@host}:#{@port}/#{data['index']}/_search/"
if @preference[0]
- base_uri.concat("preference=#{@preference[1]}")
+ base_uri.concat("preference=#{@preference[1]}''")
end
- puts base_uri
+ curl_command = "curl -s -XGET ".concat(base_uri)
+ puts curl_command.concat("' -d '#{query}''")
end
########################################################################################################################
@@ -170,7 +171,7 @@ def execute_query(query, data)
data['new_timestamp'] = Time.now
data['new_start_time'] = Time.now.to_f * 1000
#puts "curl -s -XGET #{Settings.host}:#{Settings.port}/#{data['index']}/_search/ -d '#{query}'"
- build_curl_command_string(data)
+ build_curl_command_string(query, data)
#curl_result = `curl -s -XGET '#{@host}:#{@port}/#{data['index']}/_search/' -d '#{query}'`
#data['new_end_time'] = Time.now.to_f * 1000
#data['new_duration'] = data['new_end_time'] - data['new_start_time']

0 comments on commit c4c6601

Please sign in to comment.