def readStats(self, file_id):
        statDic = {}

        binPattern = '~([^~]+) Bin Statistics'
        setPattern = '~([^~]+) Set Statistics'
        servicePattern = 'Service Statistics'
        nsPattern = '~([^~]+) Namespace Statistics'
        xdrPattern = 'XDR Statistics'
        dcPattern = '~([^~]+) DC Statistics'
        sindexPattern = '~([^~]+) Sindex Statistics'

        line = file_id.readline()
        while(not re.search(self.section_separator, line) and not re.search(self.section_separator_with_date,line)):
            if line.strip().__len__() != 0:
                dic = {}
                key = "key"
                if re.search(binPattern, line):
                    if "bins" not in statDic:
                        statDic["bins"] = {}
                    dic = statDic["bins"]
                    key = re.search(binPattern, line).group(1)
                elif re.search(setPattern, line):
                    if "sets" not in statDic:
                        statDic["sets"] = {}
                    dic = statDic["sets"]
                    key = re.search(setPattern, line).group(1)
                elif re.search(servicePattern, line):
                    dic = statDic
                    key = "service"
                elif re.search(nsPattern, line):
                    if "namespace" not in statDic:
                        statDic["namespace"] = {}
                    dic = statDic["namespace"]
                    key = re.search(nsPattern, line).group(1)
                elif re.search(xdrPattern, line):
                    dic = statDic
                    key = "xdr"
                elif re.search(dcPattern, line):
                    if "dc" not in statDic:
                        statDic["dc"] = {}
                    dic = statDic["dc"]
                    key = re.search(dcPattern, line).group(1)
                elif re.search(sindexPattern, line):
                    if "sindex" not in statDic:
                        statDic["sindex"] = {}
                    dic = statDic["sindex"]
                    key = re.search(sindexPattern, line).group(1)

                dic[key] = self.htableToDic(file_id)
            try:
                line = file_id.readline()
            except __HOLE__:
                break

        return statDic
dataset/ETHPy150Open aerospike/aerospike-admin/lib/logreader.py/LogReader.readStats