pysyncobj/syncobj.py
def getStatus(self):
        """Dumps different debug info about cluster to dict and return it"""

        status = {}
        status['version'] = VERSION
        status['revision'] = REVISION
        status['self'] = self.__selfNode
        status['state'] = self.__raftState
        status['leader'] = self.__raftLeader
        status['partner_nodes_count'] = len(self.__otherNodes)
        for node in self.__otherNodes:
            status['partner_node_status_server_' + node.id] = 2 if node in self.__connectedNodes else 0
        status['readonly_nodes_count'] = len(self.__readonlyNodes)
        for node in self.__readonlyNodes:
            status['readonly_node_status_server_' + node.id] = 2 if node in self.__connectedNodes else 0
        status['log_len'] = len(self.__raftLog)
        status['last_applied'] = self.__raftLastApplied
        status['commit_idx'] = self.__raftCommitIndex
        status['raft_term'] = self.__raftCurrentTerm
        status['next_node_idx_count'] = len(self.__raftNextIndex)
        for node, idx in iteritems(self.__raftNextIndex):
            status['next_node_idx_server_' + node.id] = idx
        status['match_idx_count'] = len(self.__raftMatchIndex)
        for node, idx in iteritems(self.__raftMatchIndex):
            status['match_idx_server_' + node.id] = idx
        status['leader_commit_idx'] = self.__leaderCommitIndex
        status['uptime'] = int(time.time() - self.__startTime)
        status['self_code_version'] = self.__selfCodeVersion
        status['enabled_code_version'] = self.__enabledCodeVersion
        return status
def getStatus(self):
        """Dumps different debug info about cluster to dict and return it"""

        status = {}
        status['version'] = VERSION
        status['revision'] = REVISION
        status['self'] = self.__selfNode
        status['state'] = self.__raftState
        status['leader'] = self.__raftLeader
        status['partner_nodes_count'] = len(self.__otherNodes)
        for node in self.__otherNodes:
            status['partner_node_status_server_' + node.id] = 2 if node in self.__connectedNodes else 0
        status['readonly_nodes_count'] = len(self.__readonlyNodes)
        for node in self.__readonlyNodes:
            status['readonly_node_status_server_' + node.id] = 2 if node in self.__connectedNodes else 0
        status['log_len'] = len(self.__raftLog)
        status['last_applied'] = self.__raftLastApplied
        status['commit_idx'] = self.__raftCommitIndex
        status['raft_term'] = self.__raftCurrentTerm
        status['next_node_idx_count'] = len(self.__raftNextIndex)
        for node, idx in iteritems(self.__raftNextIndex):
            status['next_node_idx_server_' + node.id] = idx
        status['match_idx_count'] = len(self.__raftMatchIndex)
        for node, idx in iteritems(self.__raftMatchIndex):
            status['match_idx_server_' + node.id] = idx
        status['leader_commit_idx'] = self.__leaderCommitIndex
        status['uptime'] = int(time.time() - self.__startTime)
        status['self_code_version'] = self.__selfCodeVersion
        status['enabled_code_version'] = self.__enabledCodeVersion
        return status
def getStatus ( self ) : status = { } status [ 'version' ] = VERSION status [ 'revision' ] = REVISION status [ 'self' ] = self . __selfNode status [ 'state' ] = self . __raftState status [ 'leader' ] = self . __raftLeader status [ 'partner_nodes_count' ] = len ( self . __otherNodes ) for node in self . __otherNodes : status [ 'partner_node_status_server_' + node . id ] = 2 if node in self . __connectedNodes else 0 status [ 'readonly_nodes_count' ] = len ( self . __readonlyNodes ) for node in self . __readonlyNodes : status [ 'readonly_node_status_server_' + node . id ] = 2 if node in self . __connectedNodes else 0 status [ 'log_len' ] = len ( self . __raftLog ) status [ 'last_applied' ] = self . __raftLastApplied status [ 'commit_idx' ] = self . __raftCommitIndex status [ 'raft_term' ] = self . __raftCurrentTerm status [ 'next_node_idx_count' ] = len ( self . __raftNextIndex ) for node , idx in iteritems ( self . __raftNextIndex ) : status [ 'next_node_idx_server_' + node . id ] = idx status [ 'match_idx_count' ] = len ( self . __raftMatchIndex ) for node , idx in iteritems ( self . __raftMatchIndex ) : status [ 'match_idx_server_' + node . id ] = idx status [ 'leader_commit_idx' ] = self . __leaderCommitIndex status [ 'uptime' ] = int ( time . time ( ) - self . __startTime ) status [ 'self_code_version' ] = self . __selfCodeVersion status [ 'enabled_code_version' ] = self . __enabledCodeVersion return status
Dumps different debug info about cluster to dict and return it
Dumps different debug info about cluster to dict and return it