def run(self, accessor):
        result = {}
        for bucket, stats_info in stats_buffer.buckets.iteritems():
            #print bucket, stats_info
            disk_queue_avg_error = []
            disk_queue_avg_warn = []
            drain_values = stats_info[accessor["scale"]][accessor["counter"][0]]
            len_values = stats_info[accessor["scale"]][accessor["counter"][1]]
            nodeStats = drain_values["nodeStats"]
            samplesCount = drain_values["samplesCount"]
            for node, vals in nodeStats.iteritems():
                avg = sum(vals) / samplesCount
                disk_len_vals = len_values["nodeStats"][node]
                len_avg = sum(disk_len_vals) / samplesCount
                if avg < accessor["threshold"]["drainRate"] and len_avg > accessor["threshold"]["diskLength"]:
                    disk_queue_avg_error.append({"node":node, "level":"red", "value":avg})
            if len(disk_queue_avg_error) > 0:
                result[bucket] = {"error" : disk_queue_avg_error}
        return result
dataset/ETHPy150Open membase/membase-cli/diskqueue_stats.py/DiskQueueDrainingRate.run/original