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 = []
            values = stats_info[accessor["scale"]][accessor["counter"]]
            nodeStats = values["nodeStats"]
            samplesCount = values["samplesCount"]
            for node, vals in nodeStats.iteritems():
                avg = sum(vals) / samplesCount
                if avg > accessor["threshold"]["high"]:
                    disk_queue_avg_error.append({"node":node, "level":"red", "value":avg})
                elif avg > accessor["threshold"]["low"]:
                    disk_queue_avg_warn.append({"node":node, "level":"yellow", "value":avg})
            if len(disk_queue_avg_error) > 0:
                result[bucket] = {"error" : disk_queue_avg_error}
            if len(disk_queue_avg_warn) > 0:
                result[bucket] = {"warn" : disk_queue_avg_warn}
        return result
dataset/ETHPy150Open membase/membase-cli/diskqueue_stats.py/AvgDiskQueue.run/original