Add feature exclude_markers for Phantom and JMeter

This commit is contained in:
Epikhin Mikhail 2015-04-20 00:02:00 +03:00
parent d7ecbc390b
commit f551baaa37
3 changed files with 10 additions and 3 deletions

View File

@ -275,6 +275,7 @@ class AbstractReader:
self.cumulative = SecondAggregateDataTotalItem()
self.data_queue = []
self.data_buffer = {}
self.exclude_markers = set()
def check_open_files(self):
""" open files if necessary """
@ -295,8 +296,10 @@ class AbstractReader:
datetime.datetime.fromtimestamp(next_time))
time_before = time.time()
for item in data:
self.__append_sample(result.overall, item)
marker = item[0]
if marker in self.exclude_markers:
continue
self.__append_sample(result.overall, item)
if marker:
if not marker in result.cases.keys():
result.cases[marker] = SecondAggregateDataItem()

View File

@ -41,7 +41,7 @@ class JMeterPlugin(AbstractPlugin):
return __file__
def get_available_options(self):
return ["jmx", "args", "jmeter_path", "buffer_size", "buffered_seconds", "use_argentum"]
return ["jmx", "args", "jmeter_path", "buffer_size", "buffered_seconds", "use_argentum", "exclude_markers", ]
def configure(self):
self.original_jmx = self.get_option("jmx")
@ -55,6 +55,8 @@ class JMeterPlugin(AbstractPlugin):
self.get_option('buffered_seconds', '3')))
self.core.add_artifact_file(self.jmeter_log, True)
self.use_argentum = eval(self.get_option('use_argentum', 'False'))
self.exclude_markers = set(filter((lambda marker: marker != ''),
self.get_option('exclude_markers', []).split(' ')))
self.jmx = self.__add_jmeter_components(
self.original_jmx, self.jtl_file, self._get_variables())
self.core.add_artifact_file(self.jmx)

View File

@ -52,7 +52,7 @@ class PhantomPlugin(AbstractPlugin, AggregateResultListener):
return __file__
def get_available_options(self):
opts = ["eta_file", "phantom_path", "buffered_seconds", ]
opts = ["eta_file", "phantom_path", "buffered_seconds", "exclude_markers", ]
opts += [PhantomConfig.OPTION_PHOUT, self.OPTION_CONFIG]
opts += PhantomConfig.get_available_options()
return opts
@ -66,6 +66,8 @@ class PhantomPlugin(AbstractPlugin, AggregateResultListener):
self.enum_ammo = self.get_option("enum_ammo", False)
self.buffered_seconds = int(
self.get_option("buffered_seconds", self.buffered_seconds))
self.exclude_markers = set(filter((lambda marker: marker != ''),
self.get_option('exclude_markers', []).split(' ')))
try:
autostop = self.core.get_plugin_of_type(AutostopPlugin)