Help Docs
Release Notes
Subscribe to release notes

Subscribe in a Reader
Subscribe by Email

How to Debug Your Groovy Script

Debugging might be the hardest task when you try to create a script datasource using a groovy script. To mitigate this issue, we introduce a built-in command !groovy to help you.

Step 1. Go to Setting tab -> Collectors

Step 2. Click the tools icon of the collector (which you want to use to execute the collecting), and choose "Run debug command ..."

Step 3. Enter "!groovy" (see screenshot below)

Step 4. A dialog with a big text edit box will pop up. Please edit your code there, then click "Submit"

Step 5. The collector will execute the script and show the return value and output in the debug window.

So you can repeat step 3 - step 6 until you get the script right. After you finish debugging the script, you can either copy & paste the source code from the edit box to the file or copy the file <collectorRoot>/tmp/test.groovy (that contains the source code you entered) to wherever you want.