How to use guider - 8 common examples

To help you get started, we’ve selected a few guider examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iipeace / guider / agent / __init__.py View on Github external
def request_start(timestamp, targetAddr):
        print('request_start')

        # set addresses #
        NetworkManager.prepareServerConn(None, targetAddr)

        # get connection with server #
        conn = NetworkManager.getServerConn()
        if not conn:
            print('\nFail to get connection with server')
            sys.exit(0)

        # request command #
        pipe = NetworkManager.getCmdPipe(conn, 'GUIDER top -a -J -e dn')
        if not pipe:
            print('\nFail to get command pipe')
            sys.exit(0)

        # build message #
        msg = {'timestamp': timestamp}
        RequestManager.add_request(timestamp)

        '''
        # for multi-thread feature #
        global thread
        with thread_lock:
            if thread is None:
                thread = socketio.start_background_task(thread_task)
        '''
github iipeace / guider / agent / example.py View on Github external
'''
    Choose one of below calls. (None: default address)
    1. NetworkManager.prepareServerConn(CLIENT_IP:PORT, SERVER_IP:PORT)
    2. NetworkManager.prepareServerConn(None, SERVER_IP:PORT)
    3. NetworkManager.prepareServerConn(None, None)
    '''
    NetworkManager.prepareServerConn(None, None)

    # get connection with server #
    conn = NetworkManager.getServerConn()
    if not conn:
        print('\nFail to get connection with server')
        sys.exit(0)

    # request command #
    pipe = NetworkManager.getCmdPipe(conn, 'GUIDER top -a -J')
    if not pipe:
        print('\nFail to get command pipe')
        sys.exit(0)

    # get data from server #
    while 1:
        data = pipe.getData()
        if not data:
            break

        print(data.rstrip())

    # close command pipe to terminate process on server #
    pipe.close()
github iipeace / guider / agent / example.py View on Github external
# run server before launch below client code #
    '''
    $ guider/guider.py server
    '''

    # set network info #
    '''
    Choose one of below calls. (None: default address)
    1. NetworkManager.prepareServerConn(CLIENT_IP:PORT, SERVER_IP:PORT)
    2. NetworkManager.prepareServerConn(None, SERVER_IP:PORT)
    3. NetworkManager.prepareServerConn(None, None)
    '''
    NetworkManager.prepareServerConn(None, None)

    # get connection with server #
    conn = NetworkManager.getServerConn()
    if not conn:
        print('\nFail to get connection with server')
        sys.exit(0)

    # request command #
    pipe = NetworkManager.getCmdPipe(conn, 'GUIDER top -a -J')
    if not pipe:
        print('\nFail to get command pipe')
        sys.exit(0)

    # get data from server #
    while 1:
        data = pipe.getData()
        if not data:
            break
github iipeace / guider / agent / __init__.py View on Github external
def request_start(timestamp, targetAddr):
        print('request_start')

        # set addresses #
        NetworkManager.prepareServerConn(None, targetAddr)

        # get connection with server #
        conn = NetworkManager.getServerConn()
        if not conn:
            print('\nFail to get connection with server')
            sys.exit(0)

        # request command #
        pipe = NetworkManager.getCmdPipe(conn, 'GUIDER top -a -J -e dn')
        if not pipe:
            print('\nFail to get command pipe')
            sys.exit(0)

        # build message #
        msg = {'timestamp': timestamp}
        RequestManager.add_request(timestamp)

        '''
        # for multi-thread feature #
github iipeace / guider / agent / example.py View on Github external
if __name__ == '__main__':

    # run server before launch below client code #
    '''
    $ guider/guider.py server
    '''

    # set network info #
    '''
    Choose one of below calls. (None: default address)
    1. NetworkManager.prepareServerConn(CLIENT_IP:PORT, SERVER_IP:PORT)
    2. NetworkManager.prepareServerConn(None, SERVER_IP:PORT)
    3. NetworkManager.prepareServerConn(None, None)
    '''
    NetworkManager.prepareServerConn(None, None)

    # get connection with server #
    conn = NetworkManager.getServerConn()
    if not conn:
        print('\nFail to get connection with server')
        sys.exit(0)

    # request command #
    pipe = NetworkManager.getCmdPipe(conn, 'GUIDER top -a -J')
    if not pipe:
        print('\nFail to get command pipe')
        sys.exit(0)

    # get data from server #
    while 1:
        data = pipe.getData()
github iipeace / guider / agent / __init__.py View on Github external
def request_start(timestamp, targetAddr):
        print('request_start')

        # set addresses #
        NetworkManager.prepareServerConn(None, targetAddr)

        # get connection with server #
        conn = NetworkManager.getServerConn()
        if not conn:
            print('\nFail to get connection with server')
            sys.exit(0)

        # request command #
        pipe = NetworkManager.getCmdPipe(conn, 'GUIDER top -a -J -e dn')
        if not pipe:
            print('\nFail to get command pipe')
            sys.exit(0)

        # build message #
        msg = {'timestamp': timestamp}
        RequestManager.add_request(timestamp)
github iipeace / guider / agent / common / guider.py View on Github external
def set_network_manager(cls, target_addr):
        network_mgr = NetworkMgr(mode=None, ip=None, port=None)
        network_mgr.prepareServerConn(None, target_addr)
        if target_addr not in cls.instances:
            cls.instances[target_addr] = network_mgr
github iipeace / guider / guider / __main__.py View on Github external
import os
from .guider import main

# set main environment #
os.environ["ISMAIN"] = "True"

main(args=None)

guider

Unified performance analyzer

GPL-2.0
Latest version published 7 months ago

Package Health Score

65 / 100
Full package analysis