def gather_sample(self, stat_file):
        """Gathers the metrics from the io file.

        @param stat_file: The file to read.
        @type stat_file: FileIO
        """
        # File format is single value per line with "fieldname:" prefix.
        for x in stat_file:
            fields = x.split()
            if fields[0] == "rchar:":
                self.print_sample("app.disk.bytes", int(fields[1]), "read")
            elif fields[0] == "syscr:":
                self.print_sample("app.disk.requests", int(fields[1]), "read")
            elif fields[0] == "wchar:":
                self.print_sample("app.disk.bytes", int(fields[1]), "write")
            elif fields[0] == "syscw:":
                self.print_sample("app.disk.requests", int(fields[1]), "write")
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/builtin_monitors/linux_process_metrics.py/IoReader.gather_sample/original