Getting Started
RPG Metrics can analyse RPG source without requiring you to upload source code to the web application.
IBM i Agent Mode
This is the recommended workflow for IBM i teams.
- RPG source is scanned locally on IBM i
- XLSX reports are generated locally on IBM i
- Dashboard sync is optional
- When dashboard sync is enabled, only calculated metrics are sent to RPG Metrics
- Source code does not need to be uploaded to the web application
Local-only mode
The agent can also be used without dashboard sync. In local-only mode, it produces a basic local XLSX report on IBM i and does not send metrics to the dashboard.
Manual upload mode
Manual upload may still be used for simple tests, but the IBM i Agent is the preferred workflow for real IBM i source libraries.
The IBM i Agent is currently available as a beta package for selected users.
Log in or create an account, then use the Feedback button to request the IBM i Agent beta package.
The beta package includes:
agent.pyagent.conf.examplerequirements.txtREADME.md- local scanner modules
- local XLSX report writer
Copy the agent package to the IFS. A typical location is:
/home/metrics-agent
Create a Python 3.9 virtual environment and install the requirements:
cd /home/metrics-agent
/QOpenSys/pkgs/bin/python3.9 -m venv .venv
source .venv/bin/activate
python -m pip install --progress-bar off -r requirements.txt
Copy the example config:
cp agent.conf.example agent.conf
Update the key settings in agent.conf:
AUTH_REFRESH_TOKEN=<your refresh token>
IBMI_IFS_PATH=/home/devuser/metrics-sources
REPORTS_PATH=/home/metrics-agent/reports
POLL_INTERVAL=60
Generate your agent token from your RPG Metrics profile page and paste it into agent.conf.
The agent watches the folder configured by IBMI_IFS_PATH.
Create stream files in that folder using CPYTOSTMF.
Personal scan example
CPYTOSTMF FROMMBR('/qsys.lib/&l.lib/&f.file/&n.mbr')
TOSTMF('/home/devuser/metrics-sources/&l_&f_&n.&t')
STMFOPT(*REPLACE) CVTDTA(*AUTO)
DBFCCSID(*FILE) STMFCCSID(*STDASCII)
Team scan example
CPYTOSTMF FROMMBR('/qsys.lib/&l.lib/&f.file/&n.mbr')
TOSTMF('/home/devuser/metrics-sources/TEAM_&l_&f_&n.&t')
STMFOPT(*REPLACE) CVTDTA(*AUTO)
DBFCCSID(*FILE) STMFCCSID(*STDASCII)
The agent supports these filename formats:
LIBRARY_SOURCEFILE_MEMBER.TYPETEAM_LIBRARY_SOURCEFILE_MEMBER.TYPE
Supported source types include:
RPGSQLRPGRPGLESQLRPGLERPGFREE
The IBM i Agent writes local XLSX reports to:
/home/metrics-agent/reports/
Reports are organised by team, library and source file.
The local report can include:
- Summary metrics
- Source line analysis
- Cyclomatic complexity hotspots
- RPG Free compatibility findings
If dashboard sync is enabled, calculated metrics are also visible on the View Files page.
The dashboard shows:
- Cyclomatic Complexity
- Maintainability Index
- Comment Percentage
- RPG Free compatibility counts
- Hotspots and trends, depending on enabled features
To request the IBM i Agent beta package or submit feedback, log in or create an account.