From cc84d9cf649bdf2e9be00fe7074464ba019576c6 Mon Sep 17 00:00:00 2001 From: Andrey Pohilko Date: Tue, 2 Oct 2012 11:46:17 +0400 Subject: [PATCH] Cosmetics --- Tank/Plugins/ConsoleScreen.py | 2 ++ Tank/Plugins/Loadosophia.py | 7 +++++-- Tank/Plugins/Phantom.py | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Tank/Plugins/ConsoleScreen.py b/Tank/Plugins/ConsoleScreen.py index 6319295..f4f4a01 100644 --- a/Tank/Plugins/ConsoleScreen.py +++ b/Tank/Plugins/ConsoleScreen.py @@ -462,6 +462,7 @@ class AnswSizesBlock(AbstractBlock): self.sum_out = 0 self.count = 0 self.header = screen.markup.WHITE + 'Request/Response Sizes:' + screen.markup.RESET + self.cur_count = 0 def render(self): self.lines = [self.header] @@ -469,6 +470,7 @@ class AnswSizesBlock(AbstractBlock): self.lines.append(" Avg Request at %s RPS: %d bytes" % (self.current_rps, self.sum_out / self.count)) self.lines.append(" Avg Response at %s RPS: %d bytes" % (self.current_rps, self.sum_in / self.count)) self.lines.append("") + if self.cur_count: self.lines.append(" Last Avg Request: %d bytes" % (self.cur_out / self.cur_count)) self.lines.append(" Last Avg Response: %d bytes" % (self.cur_in / self.cur_count)) for line in self.lines: diff --git a/Tank/Plugins/Loadosophia.py b/Tank/Plugins/Loadosophia.py index 9a7ed8b..8ae1c1a 100644 --- a/Tank/Plugins/Loadosophia.py +++ b/Tank/Plugins/Loadosophia.py @@ -6,13 +6,13 @@ from Tank.Plugins.ApacheBenchmark import ApacheBenchmarkPlugin from Tank.Plugins.Monitoring import MonitoringPlugin from Tank.Plugins.Phantom import PhantomPlugin import StringIO +import gzip import itertools import logging import mimetools import mimetypes import os import urllib2 -import gzip class LoadosophiaPlugin(AbstractPlugin): ''' @@ -38,7 +38,7 @@ class LoadosophiaPlugin(AbstractPlugin): self.loadosophia.file_prefix = self.get_option("file_prefix", "") self.project_key = self.get_option("project", '') - + def post_process(self, retcode): main_file = None # phantom @@ -65,6 +65,7 @@ class LoadosophiaPlugin(AbstractPlugin): self.loadosophia.send_results(self.project_key, main_file, [mon_file]) return retcode + class LoadosophiaClient: def __init__(self): @@ -197,3 +198,5 @@ class MultiPartForm(object): flattened.append('--' + self.boundary + '--') flattened.append('') return '\r\n'.join(flattened) + + diff --git a/Tank/Plugins/Phantom.py b/Tank/Plugins/Phantom.py index aef51c3..9dc1e4c 100644 --- a/Tank/Plugins/Phantom.py +++ b/Tank/Plugins/Phantom.py @@ -681,7 +681,6 @@ class PhantomReader(AbstractReader): ''' Mark second with expected rps from stepper info ''' - # TODO: 3 optimize expected rps with rolling property offset = next_time - self.first_request_time for rps, dur in Utils.pairs(self.phantom.steps): if offset < dur: