lib/ruby-jmeter/plugins/composite_graph.rb in ruby-jmeter-3.0.6 vs lib/ruby-jmeter/plugins/composite_graph.rb in ruby-jmeter-3.0.7
- old
+ new
@@ -1,11 +1,12 @@
module RubyJmeter
module Plugins
class CompositeGraph
attr_accessor :doc
include Helper
- def initialize(name, params={})
+ def initialize(params={})
+ testname = params.kind_of?(Array) ? 'CompositeGraph' : (params[:name] || 'CompositeGraph')
graphNodes = params.collect { |g| "<stringProp name=\"\">#{g[:graph]}</stringProp>"}
metricNodes = params.collect { |m| "<stringProp name=\"\">#{m[:metric]}</stringProp>"}
composite_collections = Nokogiri::XML(<<-XML.strip_heredoc)
<collectionProp name="COMPOSITE_CFG">
@@ -17,10 +18,10 @@
</collectionProp>
</collectionProp>
XML
@doc = Nokogiri::XML(<<-XML.strip_heredoc)
- <kg.apc.jmeter.vizualizers.CompositeResultCollector guiclass="kg.apc.jmeter.vizualizers.CompositeGraphGui" testclass="kg.apc.jmeter.vizualizers.CompositeResultCollector" testname="#{name}" enabled="true">
+ <kg.apc.jmeter.vizualizers.CompositeResultCollector guiclass="kg.apc.jmeter.vizualizers.CompositeGraphGui" testclass="kg.apc.jmeter.vizualizers.CompositeResultCollector" testname="#{testname}" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>