arthas_watch
Monitor method execution in a Java process by defining class and method patterns. Returns results inline or provides a job ID for async retrieval.
Instructions
Watch method execution. Runs in background; waits up to awaitMs for completion and returns results inline if done, otherwise returns a job ID. Use arthas_read_log to check output later, arthas_stop_job to stop.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of times to watch (default: 5) | |
| depth | No | Object traversal depth | |
| before | No | Watch before method execution | |
| awaitMs | No | Wait up to this many ms for inline completion before returning a job ID (default: 5000; pass 0 for pure async) | |
| express | No | OGNL expression (default: {params,returnObj,throwExp}) | |
| timeout | No | Timeout in ms | |
| condition | No | Conditional expression | |
| exception | No | Watch only on exception | |
| classPattern | Yes | Class name pattern | |
| methodPattern | Yes | Method name pattern |