def run(self, accessor):
        result = {}
        for bucket, stats_info in stats_buffer.buckets.iteritems():
            trend_error = []
            trend_warn = []
            values = stats_info[accessor["scale"]][accessor["counter"]]
            timestamps = values["timestamp"]
            timestamps = [x - timestamps[0] for x in timestamps]
            nodeStats = values["nodeStats"]
            samplesCount = values["samplesCount"]
            for node, vals in nodeStats.iteritems():
                a, b = util.linreg(timestamps, vals)
                if a > accessor["threshold"]["high"]:
                    trend_error.append({"node":node, "level":"red", "value":a})
                elif a > accessor["threshold"]["low"]:
                    trend_warn.append({"node":node, "level":"yellow", "value":a})
            if len(trend_error) > 0:
                result[bucket] = {"error" : trend_error}
            if len(trend_warn) > 0:
                result[bucket] = {"warn" : trend_warn}
        return result
dataset/ETHPy150Open membase/membase-cli/diskqueue_stats.py/TapQueueTrend.run/original