def get_tp_status(self,tp_stats_output): tpstats_rows = tp_stats_output.split('\n') thread_pool_stats_list = [] for row_index in range(1, len(tpstats_rows)): cols = tpstats_rows[row_index].split() # If tpstats len(cols) > 2, else we have reached the end if len(cols) > 2: if (cols[0] in ThreadPoolNames): # Create a CassandraThreadPoolStats for matching entries tpstat = CassandraThreadPoolStats() tpstat.pool_name = cols[0] tpstat.active = int(cols[1]) tpstat.pending = int(cols[2]) tpstat.all_time_blocked = int(cols[5]) thread_pool_stats_list.append(tpstat) else: # Reached end of tpstats, breaking because dropstats follows break return thread_pool_stats_list
def get_tp_status(self, tp_stats_output): tpstats_rows = tp_stats_output.split('\n') thread_pool_stats_list = [] for row_index in range(1, len(tpstats_rows)): cols = tpstats_rows[row_index].split() # If tpstats len(cols) > 2, else we have reached the end if len(cols) > 2: if (cols[0] in ThreadPoolNames): # Create a CassandraThreadPoolStats for matching entries tpstat = CassandraThreadPoolStats() tpstat.pool_name = cols[0] tpstat.active = int(cols[1]) tpstat.pending = int(cols[2]) tpstat.all_time_blocked = int(cols[5]) thread_pool_stats_list.append(tpstat) else: # Reached end of tpstats, breaking because dropstats follows break return thread_pool_stats_list