def old_bdn_performance_stats_message( self, original_message: BdnPerformanceStatsMessage ) -> BdnPerformanceStatsMessageV9: _, single_node_stats = next(iter( original_message.node_stats().items())) return BdnPerformanceStatsMessageV9( original_message.interval_start_time(), original_message.interval_end_time(), single_node_stats.new_blocks_received_from_blockchain_node, single_node_stats.new_blocks_received_from_bdn, single_node_stats.new_tx_received_from_blockchain_node, single_node_stats.new_tx_received_from_bdn, )
def old_bdn_performance_stats_message( self, original_message: BdnPerformanceStatsMessage ) -> BdnPerformanceStatsMessageV16: _, single_node_stats = next(iter( original_message.node_stats().items())) return BdnPerformanceStatsMessageV16( original_message.interval_start_time(), original_message.interval_end_time(), single_node_stats.new_blocks_received_from_blockchain_node, single_node_stats.new_blocks_received_from_bdn, single_node_stats.new_tx_received_from_blockchain_node, single_node_stats.new_tx_received_from_bdn, original_message.memory_utilization(), single_node_stats.new_blocks_seen, single_node_stats.new_block_messages_from_blockchain_node, single_node_stats.new_block_announcements_from_blockchain_node)
def old_bdn_performance_stats_message( self, original_message: BdnPerformanceStatsMessage ) -> BdnPerformanceStatsMessageV18: new_node_stats = {} for endpoint, old_stats in original_message.node_stats().items(): new_stats = BdnPerformanceStatsDataV18() new_stats.new_blocks_received_from_blockchain_node = old_stats.new_blocks_received_from_blockchain_node new_stats.new_blocks_received_from_bdn = old_stats.new_blocks_received_from_bdn new_stats.new_blocks_seen = old_stats.new_blocks_seen new_stats.new_block_messages_from_blockchain_node = old_stats.new_block_messages_from_blockchain_node new_stats.new_block_announcements_from_blockchain_node = old_stats.new_block_announcements_from_blockchain_node new_stats.new_tx_received_from_blockchain_node = old_stats.new_tx_received_from_blockchain_node new_stats.new_tx_received_from_bdn = old_stats.new_tx_received_from_bdn new_node_stats[endpoint] = new_stats return BdnPerformanceStatsMessageV18( original_message.interval_start_time(), original_message.interval_end_time(), original_message.memory_utilization(), new_node_stats)