def size(self): try: size_indexes = float( ((os.popen("stat -Lc %s " + self.dataFolder + "/*.lax | awk '{t+=$1}END{print t}'") ).read().split('\t'))[0]) / (1024. * 1024.) except: size_indexes = 0. if self.dbIndex: connection = self.getConnection() cursor = connection.cursor() size_indexes += float(postgresops.getSizes(cursor)[-1]) connection.close() try: size_ex_indexes = float( ((os.popen("stat -Lc %s " + self.dataFolder + "/*." + self.dataExtension + " | awk '{t+=$1}END{print t}'") ).read().split('\t'))[0]) / (1024. * 1024.) except: size_ex_indexes = 0 size_total = size_indexes + size_ex_indexes return ' Size indexes= ' + ( '%.3f MB' % size_indexes) + '. Size excluding indexes= ' + ( '%.3f MB' % size_ex_indexes) + '. Size total= ' + ('%.3f MB' % size_total)
def size(self): connection = self.getConnection() cursor = connection.cursor() row = postgresops.getSizes(cursor) for i in range(len(row)): if row[i] != None: row[i] = '%.3f MB' % row[i] (size_indexes, size_ex_indexes, size_total) = row cursor.close() connection.close() return ' Size indexes= ' + str( size_indexes) + '. Size excluding indexes= ' + str( size_ex_indexes) + '. Size total= ' + str(size_total)
def size(self): try: size_indexes = float(((os.popen("stat -Lc %s " + self.dataFolder + "/*.lax | awk '{t+=$1}END{print t}'")).read().split('\t'))[0]) / (1024. * 1024.) except: size_indexes = 0. if self.dbIndex: connection = self.getConnection() cursor = connection.cursor() size_indexes += float(postgresops.getSizes(cursor)[-1]) connection.close() try: size_ex_indexes = float(((os.popen("stat -Lc %s " + self.dataFolder + "/*." + self.dataExtension + " | awk '{t+=$1}END{print t}'")).read().split('\t'))[0]) / (1024. * 1024.) except: size_ex_indexes = 0 size_total = size_indexes + size_ex_indexes return ' Size indexes= ' + ('%.3f MB' % size_indexes) + '. Size excluding indexes= ' + ('%.3f MB' % size_ex_indexes) + '. Size total= ' + ('%.3f MB' % size_total)
def size(self): connection = self.getConnection() cursor = connection.cursor() row = postgresops.getSizes(cursor) for i in range(len(row)): if row[i] != None: row[i] = "%.3f MB" % row[i] (size_indexes, size_ex_indexes, size_total) = row cursor.close() connection.close() return ( " Size indexes= " + str(size_indexes) + ". Size excluding indexes= " + str(size_ex_indexes) + ". Size total= " + str(size_total) )