Class: Gridinit::Jmeter::Throughput

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/gridinit-jmeter/controllers/throughput.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#enabled, #update

Constructor Details

#initialize(name, percent, params = {}) ⇒ Throughput

Returns a new instance of Throughput.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/gridinit-jmeter/controllers/throughput.rb', line 7

def initialize(name, percent, params={})
  @doc = Nokogiri::XML(<<-EOF.strip_heredoc)
    <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="#{percent.to_i}%_#{name}" enabled="true">
    <intProp name="ThroughputController.style">1</intProp>
    <boolProp name="ThroughputController.perThread">false</boolProp>
    <intProp name="ThroughputController.maxThroughput">1</intProp>
    <FloatProperty>
      <name>ThroughputController.percentThroughput</name>
      <value>#{percent.to_f}</value>
      <savedValue>0.0</savedValue>
    </FloatProperty>
  </ThroughputController>
  EOF
  update params
end

Instance Attribute Details

#docObject

Returns the value of attribute doc.



5
6
7
# File 'lib/gridinit-jmeter/controllers/throughput.rb', line 5

def doc
  @doc
end