Mercurial > hg > Members > nobuyasu > jungle_benchmark
comparison distributed/nodes_stress_write_cassandra.rb @ 7:867cd5f213d3
Added distributed directory
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 11 Jan 2014 03:24:53 +0900 |
parents | |
children | 9ed378589601 |
comparison
equal
deleted
inserted
replaced
6:593786973c04 | 7:867cd5f213d3 |
---|---|
1 #!/usr/bin/ruby | |
2 | |
3 require 'net/http' | |
4 require 'benchmark' | |
5 require './get_node_name.rb' | |
6 include GetNodeName | |
7 | |
8 schedule = ARGV[0].to_i | |
9 time = Time.now.to_i | |
10 sleepTime = schedule - time | |
11 sleep(sleepTime) | |
12 | |
13 nodename = get_node_name("nodes.txt") | |
14 | |
15 tms = Benchmark.measure { | |
16 count = ARGV[1].to_i | |
17 uri = URI.parse('http://'+nodename+':8080/editMessage?bname=hello%20world&uuid=13814000-1dd2-11b2-93d6-02864ec060b6') | |
18 count.times {|i| | |
19 res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"fugafuga #{i}"}) | |
20 } | |
21 } | |
22 puts tms.real | |
23 |