rubberband_flamethrower 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +23 -2
- data/VERSION +1 -1
- data/bin/flamethrower +2 -2
- data/lib/rubberband_flamethrower.rb +2 -2
- data/lib/rubberband_flamethrower/flamethrower.rb +2 -2
- data/rubberband_flamethrower.gemspec +2 -2
- metadata +13 -13
data/README.md
CHANGED
@@ -88,7 +88,29 @@ To run the "flamethrower fire" command 5 times, inserting 5,000 objects each ti
|
|
88
88
|
flamethrower auto 5 5000
|
89
89
|
|
90
90
|
The id_overwrite parameter determines the ID strategy used for subsequent batches in the auto command. When set to "n" ("n" is the default) each batch will be writing new data with unused IDs to the Elastic Search server, simulating a system where new data is constantly being inserted and not updated. 5 batches of 500 with an "n" would use the IDs 1-2500. When it is set to "y" each batch (after the first) will be overwriting existing data on the Elastic Search server, simulating a system where data is constantly being updated (after the initial batch). 5 batches of 500 with a setting of "y" would use the IDs 1-500 on each batch.
|
91
|
-
|
91
|
+
|
92
|
+
#### Generate Dataset
|
93
|
+
|
94
|
+
The "generate_dataset" command can be used to create a set of documents for insertion that can be used over and over. This is useful when you are benchmarking one possible configuration against another and want to use consistent data for each run. The generated file will contain one JSON document per line.
|
95
|
+
|
96
|
+
flamethrower generate_dataset
|
97
|
+
|
98
|
+
This will generate a batch of 500 documents and store it in a local file called "dataset". You can configure the size of the dataset by providing an additional parameter to the command.
|
99
|
+
|
100
|
+
To generate a dataset of 10,000 documents:
|
101
|
+
|
102
|
+
flamethrower generate_dataset 10000
|
103
|
+
|
104
|
+
The dataset will always be written to a file named "dataset". If you want to generate multiple dataset files you will need to rename the first file before generating a second.
|
105
|
+
|
106
|
+
#### Load Dataset
|
107
|
+
|
108
|
+
The "load_dataset" command can be used much like the "fire" command only the data inserted will come from the dataset file rather than being randomly generated. You can create your own dataset file if you would like.
|
109
|
+
|
110
|
+
flamethrower load_dataset
|
111
|
+
|
112
|
+
The command can be configured much like the "fire" command, but the first parameter accepted is not the number of documents to generate and insert but is instead the filename of the dataset. The parameters in order with their default values: (filename="dataset", starting_id=1, server_url="http://localhost:9200", index="twitter", type="tweet")
|
113
|
+
|
92
114
|
#### Help
|
93
115
|
|
94
116
|
The command with the argument "help" or without any arguments will display the help screen:
|
@@ -136,7 +158,6 @@ To put your documents into an index named "facebook" instead of "twitter" with a
|
|
136
158
|
* Commit and push until you are happy with your contribution.
|
137
159
|
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
138
160
|
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
139
|
-
|
140
161
|
## Copyright
|
141
162
|
|
142
163
|
Copyright (c) 2013 Michael Orr. See LICENSE.txt for
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/bin/flamethrower
CHANGED
@@ -14,8 +14,8 @@ when "fire"
|
|
14
14
|
RubberbandFlamethrower.fire(*args)
|
15
15
|
when "generate_dataset"
|
16
16
|
RubberbandFlamethrower.generate_dataset(*args)
|
17
|
-
when "
|
18
|
-
RubberbandFlamethrower.
|
17
|
+
when "load_dataset"
|
18
|
+
RubberbandFlamethrower.load_dataset(*args)
|
19
19
|
when "help"
|
20
20
|
RubberbandFlamethrower.help
|
21
21
|
else
|
@@ -48,11 +48,11 @@ module RubberbandFlamethrower
|
|
48
48
|
data.generate_dataset(batch_size)
|
49
49
|
end
|
50
50
|
|
51
|
-
def self.
|
51
|
+
def self.load_dataset(filename="dataset", starting_id=1, server_url="http://localhost:9200", index="twitter", type="tweet")
|
52
52
|
require File.dirname(__FILE__)+"/rubberband_flamethrower/flamethrower.rb"
|
53
53
|
flamethrower = Flamethrower.new
|
54
54
|
time = Benchmark.measure do
|
55
|
-
flamethrower.
|
55
|
+
flamethrower.load_dataset(filename, starting_id, server_url, index, type, 1)
|
56
56
|
end
|
57
57
|
puts "\nFinished Inserting Dataset (#{filename}) into Elastic Search."
|
58
58
|
puts " user system total real"
|
@@ -48,12 +48,12 @@ module RubberbandFlamethrower
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
def
|
51
|
+
def load_dataset(filename, starting_id, server_url, index, type, printing_level=0)
|
52
52
|
# this will constantly flush the printing to the display so the progress dots appear for each insert
|
53
53
|
($stdout.sync = true) if printing_level == 1
|
54
54
|
# a unique ID must be provided for each document stored in Elastic Search
|
55
55
|
id = starting_id.to_i
|
56
|
-
# loop through lines in the file and insert each
|
56
|
+
# loop through lines in the file and insert each line, each line is a document from the data generator
|
57
57
|
IO.foreach(filename) do |line|
|
58
58
|
(puts insert_data) if printing_level == 2
|
59
59
|
response = HTTParty.put("#{server_url}/#{index}/#{type}/#{id}", body: line)
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "rubberband_flamethrower"
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Orr"]
|
12
|
-
s.date = "2013-04-
|
12
|
+
s.date = "2013-04-18"
|
13
13
|
s.description = "Use to quickly fill up some indicies in Elastic Search and to retrieve statistics about insertion rates"
|
14
14
|
s.email = "michael@cloudspace.com"
|
15
15
|
s.executables = ["flamethrower"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubberband_flamethrower
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &12013880 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.10.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *12013880
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &12026700 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.2.13
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *12026700
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rdoc
|
38
|
-
requirement: &
|
38
|
+
requirement: &12024060 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.12'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *12024060
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &12021660 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.3.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *12021660
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: jeweler
|
60
|
-
requirement: &
|
60
|
+
requirement: &12116420 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 1.8.4
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *12116420
|
69
69
|
description: Use to quickly fill up some indicies in Elastic Search and to retrieve
|
70
70
|
statistics about insertion rates
|
71
71
|
email: michael@cloudspace.com
|
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
segments:
|
117
117
|
- 0
|
118
|
-
hash:
|
118
|
+
hash: 1992718283200154027
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
none: false
|
121
121
|
requirements:
|