Class: JmeterPerf::Plugins::JMXCollector

Inherits:
Object
  • Object
show all
Includes:
Helpers::XmlDocumentUpdater
Defined in:
lib/jmeter_perf/plugins/jmx_collector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ JMXCollector

Returns a new instance of JMXCollector.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/jmeter_perf/plugins/jmx_collector.rb', line 6

def initialize(params = {})
  params[:name] ||= "JMX Collector"
  params[:jtl] ||= ""
  params[:attribute_key] ||= ""

  @doc = Nokogiri::XML(
    JmeterPerf::Helpers::String.strip_heredoc(
      "        <kg.apc.jmeter.jmxmon.JMXMonCollector guiclass=\"kg.apc.jmeter.vizualizers.JMXMonGui\" testclass=\"kg.apc.jmeter.jmxmon.JMXMonCollector\" testname=\"\#{params[:name]}\" enabled=\"true\">\n          <boolProp name=\"ResultCollector.error_logging\">false</boolProp>\n          <objProp>\n            <name>saveConfig</name>\n            <value class=\"SampleSaveConfiguration\">\n              <time>true</time>\n              <latency>true</latency>\n              <timestamp>true</timestamp>\n              <success>true</success>\n              <label>true</label>\n              <code>true</code>\n              <message>true</message>\n              <threadName>true</threadName>\n              <dataType>true</dataType>\n              <encoding>false</encoding>\n              <assertions>true</assertions>\n              <subresults>true</subresults>\n              <responseData>false</responseData>\n              <samplerData>false</samplerData>\n              <xml>false</xml>\n              <fieldNames>true</fieldNames>\n              <responseHeaders>false</responseHeaders>\n              <requestHeaders>false</requestHeaders>\n              <responseDataOnError>false</responseDataOnError>\n              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>\n              <assertionsResultsToSave>0</assertionsResultsToSave>\n              <bytes>true</bytes>\n              <threadCounts>true</threadCounts>\n              <idleTime>true</idleTime>\n            </value>\n          </objProp>\n          <stringProp name=\"filename\">\#{params[:jtl]}</stringProp>\n          <longProp name=\"interval_grouping\">1000</longProp\n          <boolProp name=\"graph_aggregated\">false</boolProp>\n          <stringProp name=\"include_sample_labels\"></stringProp>\n          <stringProp name=\"exclude_sample_labels\"></stringProp>\n          <stringProp name=\"start_offset\"></stringProp>\n          <stringProp name=\"end_offset\"></stringProp>\n          <boolProp name=\"include_checkbox_state\">false</boolProp>\n          <boolProp name=\"exclude_checkbox_state\">false</boolProp>\n          <collectionProp name=\"samplers\">\n            <collectionProp name=\"311458936\">\n              <stringProp name=\"label\"></stringProp>\n              <stringProp name=\"service_endpoint\">service:jmx:rmi:///jndi/rmi://\#{params[:host]}:\#{params[:port]}/jmxrmi</stringProp>\n              <stringProp name=\"username\"></stringProp>\n              <stringProp name=\"password\"></stringProp>\n              <stringProp name=\"object_name\">\#{params[:object_name]}</stringProp>\n              <stringProp name=\"attribute_name\">\#{params[:attribute_name]}</stringProp>\n              <stringProp name=\"attribute_key\">\#{params[:attribute_key]}</stringProp>\n              <stringProp name=\"delta\">false</stringProp>\n              <stringProp name=\"retry\">true</stringProp>\n            </collectionProp>\n          </collectionProp>\n        </kg.apc.jmeter.jmxmon.JMXMonCollector>\n      XML\n    )\n  )\nend\n"

Instance Attribute Details

#docObject

Returns the value of attribute doc.



4
5
6
# File 'lib/jmeter_perf/plugins/jmx_collector.rb', line 4

def doc
  @doc
end