dns_load 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4529541759b3ce008a1aab7c48a1c3658b297d14
4
+ data.tar.gz: cc9d0d1459def84df042f43138db0b172f86f34d
5
+ SHA512:
6
+ metadata.gz: 38c92d275ec020d8e23f384c6dc44a88fff36faadcb5ffd751e2961164f40318f1aef2503b1ecaf43d649fe6a95dde206adc53de4bb4be61b16de0be0c7905fb
7
+ data.tar.gz: 3e0a81f7fe9963c0ef605de04501495bff367040fee8c2662c15b2fc5edf0b1a40968751517cf2083cd2a53ba81b8d242b1bbd5d14c41f6d0017c0ff8ad87dc1
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1 @@
1
+ gemdev
@@ -0,0 +1 @@
1
+ ruby-2.0.0
@@ -0,0 +1 @@
1
+ jruby-1.7.5
@@ -0,0 +1 @@
1
+ ruby-2.0.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in dns_load.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Jason Harrelson
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ # DnsLoad
2
+
3
+ Toolset for testing DNS server loads.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'dns_load'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install dns_load
18
+
19
+ ## Usage
20
+
21
+ $ dns-load -r 5000 -i 1 -d google.com,yahoo.com
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'dns_load/cli'
4
+
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'dns_load/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "dns_load"
8
+ spec.version = DnsLoad::VERSION
9
+ spec.authors = ["C. Jason Harrelson"]
10
+ spec.email = ["jason@lookforwardenterprises.com"]
11
+ spec.description = %q{Toolset for testing DNS server loads.}
12
+ spec.summary = %q{Toolset for testing DNS server loads.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = ['dns-load'] #spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "celluloid"#, "~> 0"
22
+ #spec.add_dependency "spoon", "~> 0"
23
+ spec.add_dependency "trollop", "~> 2"
24
+ #spec.add_dependency "yell", "~> 1"
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.3"
27
+ spec.add_development_dependency "rake"
28
+ #spec.add_development_dependency "ruby-debug"
29
+ end
@@ -0,0 +1,9 @@
1
+ require "dns_load/version"
2
+
3
+ module DnsLoad
4
+
5
+ autoload :Dig, 'dns_load/dig'
6
+
7
+ VERSION_COPYRIGHT = "v#{VERSION} \u00A9 2013 C. Jason Harrelson"
8
+
9
+ end
@@ -0,0 +1,36 @@
1
+ require 'rubygems'
2
+ require 'dns_load'
3
+ require 'trollop'
4
+
5
+ opts = Trollop::options do
6
+ version DnsLoad::VERSION_COPYRIGHT
7
+ banner <<-EOS
8
+ DNS Load #{DnsLoad::VERSION_COPYRIGHT}
9
+
10
+ Usage:
11
+ dns_load [options]
12
+
13
+ options:
14
+ EOS
15
+ opt :domains, "One or more domains to query for", short: '-d', type: String
16
+ opt :num_requests, "The number of requests to perform per iteration", default: 5000, short: '-r', type: Integer
17
+ opt :num_iterations, "The number of iterations to perform", default: 1, short: '-i', type: Integer
18
+ opt :pool_size, "The size of the execution pool", default: 2, short: '-p', type: Integer
19
+ end
20
+
21
+
22
+ Trollop::die( :domains, "is required" ) unless opts[:domains]
23
+
24
+ $stdout.puts "No. of Requests: #{opts[:num_requests]}",
25
+ "No. of Iterations: #{opts[:num_iterations]}",
26
+ "Pool Size: #{opts[:pool_size]}"
27
+
28
+ pool = DnsLoad::Dig.pool( size: opts[:pool_size] )
29
+
30
+ future = nil
31
+
32
+ opts[:num_iterations].times do
33
+ future = pool.future.execute( opts[:num_requests], opts[:domains].split( ',' ))
34
+ end
35
+
36
+ future.value
@@ -0,0 +1,19 @@
1
+ require 'celluloid/autostart'
2
+
3
+ module DnsLoad
4
+ class Dig
5
+
6
+ include Celluloid
7
+
8
+ def cmd( domain )
9
+ "dig @127.0.0.1 -p 5300 #{domain}"
10
+ end
11
+
12
+ def execute( num_requests, domains )
13
+ cmds = []
14
+ num_requests.times { cmds << cmd( domains.sample ) }
15
+ `#{cmds.join( '; ' )}`
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ module DnsLoad
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dns_load
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - C. Jason Harrelson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: celluloid
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: trollop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Toolset for testing DNS server loads.
70
+ email:
71
+ - jason@lookforwardenterprises.com
72
+ executables:
73
+ - dns-load
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - .ruby-gemset
79
+ - .ruby-version
80
+ - .ruby-version-jruby
81
+ - .ruby-version-ruby2
82
+ - Gemfile
83
+ - LICENSE.txt
84
+ - README.md
85
+ - Rakefile
86
+ - bin/dns-load
87
+ - dns_load.gemspec
88
+ - lib/dns_load.rb
89
+ - lib/dns_load/cli.rb
90
+ - lib/dns_load/dig.rb
91
+ - lib/dns_load/version.rb
92
+ homepage: ''
93
+ licenses:
94
+ - MIT
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - '>='
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubyforge_project:
112
+ rubygems_version: 2.0.5
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: Toolset for testing DNS server loads.
116
+ test_files: []