Changeset 6775


Ignore:
Timestamp:
Feb 6, 2018, 3:07:51 PM (19 months ago)
Author:
mabarracus
Message:

fix bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/sbin/analyticsd

    r6774 r6775  
    275275            print(e)
    276276
    277     def check_temporary_tables_size(self,table_name):
     277    def check_temporary_tables_size(self,table_name,is_tmp=False):
    278278        if self.t != 'load':
    279279            return None
     
    281281            size = 0
    282282            rows = 0
    283             self.cur.execute('select floor((data_length + index_length) / 1048576) `size`,table_rows from information_schema.TABLES where table_schema = "analytics" and table_name = "{}";'.format(table_name))
     283            if is_tmp:
     284                self.cur.execute('select floor((data_length + index_length - data_free) / 1048576) `size`,table_rows from information_schema.TABLES where table_schema = "analytics" and table_name = "{}";'.format(table_name))
     285            else:
     286                self.cur.execute('select floor((data_length + index_length) / 1048576) `size`,table_rows from information_schema.TABLES where table_schema = "analytics" and table_name = "{}";'.format(table_name))
    284287
    285288            res=self.cur.fetchone()
     
    812815                self.cfg.write()
    813816                ctime=0.0
    814                 self.temporary_tables_size['clients'],self.temporary_tables_rows['clients']=db.check_temporary_tables_size('tmp_clients')
    815                 self.temporary_tables_size['packages'],self.temporary_tables_rows['packages']=db.check_temporary_tables_size('tmp_packages')
     817                self.temporary_tables_size['clients'],self.temporary_tables_rows['clients']=db.check_temporary_tables_size('tmp_clients',True)
     818                self.temporary_tables_size['packages'],self.temporary_tables_rows['packages']=db.check_temporary_tables_size('tmp_packages',True)
    816819                self.db_tables_size['clients'],self.db_tables_rows['clients']=db.check_temporary_tables_size('Client_Versions')
    817820                self.db_tables_size['packages'],self.db_tables_rows['packages']=db.check_temporary_tables_size('RecvPackages')
Note: See TracChangeset for help on using the changeset viewer.