Run the below command to generate pydocs for the package. Code base has doc strings describing the methods and classes from which the document is generated.
> python -m pydoc -bOther README files can be found in the following directory:
/config/README.md: Describes the primary and secondary config files which the user has to modify
/outputs/README.md: Describes the output files generated by the analyzer
> sudo apt-get install sysstat
or
> sudo yum install sysstatranger.accesslog.pattern to include the %D in the access pattern so that the tomcat server also logs the api execution time
> apt-get install sshpass
or
> brew install hudochenkov/sshpass/sshpasscd into python directory before executing below commands
Ensure you have Python 3.11 installed.
It is recommended to create a virtual environment using this version and work inside it.
Use the package manager pip to install requirements for running the performance tests.
> pip install -r requirements.txtFirst time usage or to reset the config files:
> python setup_performance_analyzer.pySubsequent usage:
Fill out the config details (primary_config.json and secondary_config.json) in /config folder or keep default
For multiple api testing (Uses values from config file).
usage:
> python3 performance_analyzer.pyFor single api testing (Command line arguments override config file values)
usage:
> python performance_analyzer.py --ranger_url <ranger_url> --calls <number of times to call api> --api <name of function of python client corresponding to api> --username <Auth username> --password <Auth password> --client_ip <client ip address> --ssh_host <ranger host to connect for ssh> --ssh_user <Server user e.g. root> --ssh_password <Server password>Example command:
> python3 performance_analyzer.py --ranger_url http://ranger_host:ranger_admin_port --calls 10 --api create_policy --username admin --password Admin123 --client_ip vpn_ip_client_in_logs --ssh_host ranger_host --ssh_user ssh_user --ssh_password ssh_password