yandextank/plugins/Phantom/reader.py
def _decode_stat_data(self, chunk):
        """
        Return all items found in this chunk
        """
        for date_str, statistics in chunk.iteritems():
            date_obj = datetime.datetime.strptime(
                date_str.split(".")[0], '%Y-%m-%d %H:%M:%S')
            chunk_date = int(time.mktime(date_obj.timetuple()))
            instances = 0
            for benchmark_name, benchmark in statistics.iteritems():
                if not benchmark_name.startswith("benchmark_io"):
                    continue
                for method, meth_obj in benchmark.iteritems():
                    if "mmtasks" in meth_obj:
                        instances += meth_obj["mmtasks"][2]

            offset = chunk_date - 1 - self.start_time
            reqps = 0
            if 0 <= offset < len(self.phantom_info.steps):
                reqps = self.phantom_info.steps[offset][0]
            yield self.stats_item(chunk_date - 1, instances, reqps)
def _decode_stat_data(self, chunk):
        """
        Return all items found in this chunk
        """
        for date_str, statistics in chunk.iteritems():
            date_obj = datetime.datetime.strptime(
                date_str.split(".")[0], '%Y-%m-%d %H:%M:%S')
            chunk_date = int(time.mktime(date_obj.timetuple()))
            instances = 0
            for benchmark_name, benchmark in statistics.iteritems():
                if not benchmark_name.startswith("benchmark_io"):
                    continue
                for method, meth_obj in benchmark.iteritems():
                    if "mmtasks" in meth_obj:
                        instances += meth_obj["mmtasks"][2]

            offset = chunk_date - 1 - self.start_time
            reqps = 0
            if 0 <= offset < len(self.phantom_info.steps):
                reqps = self.phantom_info.steps[offset][0]
            yield self.stats_item(chunk_date - 1, instances, reqps)
def _decode_stat_data ( self , chunk ) : for date_str , statistics in chunk . iteritems ( ) : date_obj = datetime . datetime . strptime ( date_str . split ( "." ) [ 0 ] , '%Y-%m-%d %H:%M:%S' ) chunk_date = int ( time . mktime ( date_obj . timetuple ( ) ) ) instances = 0 for benchmark_name , benchmark in statistics . iteritems ( ) : if not benchmark_name . startswith ( "benchmark_io" ) : continue for method , meth_obj in benchmark . iteritems ( ) : if "mmtasks" in meth_obj : instances += meth_obj [ "mmtasks" ] [ 2 ] offset = chunk_date - 1 - self . start_time reqps = 0 if 0 <= offset < len ( self . phantom_info . steps ) : reqps = self . phantom_info . steps [ offset ] [ 0 ] yield self . stats_item ( chunk_date - 1 , instances , reqps )
Return all items found in this chunk
Return all items found in this chunk