def _counting(statsname):
    """Decorator for counting calls to decorated instance methods.
    Counters are stored in statistics attribute of the instance.

    Args:
        statsname (str): name of the counter to increment
    """
    def _counter_out(f):
        def _counter(self, *args, **kwargs):
            self.statistics[statsname] += 1
            f(self, *args, **kwargs)
            self.publish_status()
        return _counter
    return _counter_out