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

        @param stat_file: The file to read.
        @type stat_file: FileIO
        """
        for line in stat_file:
            # We just look for the different "inuse" lines and output their
            # socket type along with the count.
            m = re.search('(\w+): inuse (\d+)', line)
            if m is not None:
                self.print_sample("app.net.sockets_in_use", int(m.group(2)),
                                  m.group(1).lower())
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/builtin_monitors/linux_process_metrics.py/SockStatReader.gather_sample/original