Mercurial > hg > Members > nobuyasu > jungle_benchmark
view distributed/nodes_stress_write_cassandra.rb @ 8:9ed378589601
Modified benchmark program
author | Nobuyasu |
---|---|
date | Sat, 11 Jan 2014 03:44:39 +0900 |
parents | 867cd5f213d3 |
children | f94fc7812cd8 |
line wrap: on
line source
#!/usr/bin/ruby require 'net/http' require 'benchmark' require 'uri' require '/home/mass/share/student/k128576/jungle_benchmark/distributed/get_node_name.rb' include GetNodeName schedule = ARGV[0].to_i time = Time.now.to_i sleepTime = schedule - time sleep(sleepTime) nodename = get_node_name("/home/mass/share/student/k128576/jungle_benchmark/distributed/nodes.txt") r = Benchmark.measure { count = ARGV[1].to_i uri = URI.parse('http://'+nodename.chomp+':8080/editMessage?bname=hello%20world&uuid=13814000-1dd2-11b2-93d6-02864ec060b6') count.times {|i| res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"fugafuga #{i}"}) } } puts r.real