<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plain_payload(self):
 """obtain stats payload in plaintext format"""

        tstamp = int(time.time())
        payload = []
        for item in self.counters:
            payload.append('%s.%s%s %s %s\n' % (self.rate_prefix,
                                                item,
                                                self.rate_suffix,
                                                self.counters[item] /
                                                self.flush_interval,
                                                tstamp))
            payload.append('%s.%s%s %s %s\n' % (self.count_prefix,
                                                item,
                                                self.count_suffix,
                                                self.counters[item],
                                                tstamp))
            self.counters[item] = 0

        for key in self.timers:
            if len(self.timers[key]) > 0:
                self.process_timer_key(key, tstamp, payload)
                self.timers[key] = []

        for key in self.gauges:
            payload.append("%s.%s %d %d\n" % (self.gauge_prefix, key,
                                              self.gauges[key], tstamp))
            self.gauges[key] = 0

        if self.debug:
            print payload

        if payload:
            return "".join(payload)
        else:
            return None