You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/en/_sources/advanced-use.md.txt

80 lines
3.5 KiB
Plaintext

6 years ago
Advanced Usage
==============
## Basic
6 years ago
* help - display Arthas help
* cls - clear the screen
* session - display current session information
* [reset](reset.md) - reset all the enhanced classes. All enhanced classes will also be reset when Arthas server is closed by `shutdown`
* version - print the version for the Arthas attached to the current Java process
* quit/exit - exit the current Arthas session, without effecting other sessions
* shutdown - terminate the Arthas server, all Arthas sessions will be destroyed
* [keymap](keymap.md) - keymap for Arthas keyboard shortcut
6 years ago
6 years ago
## JVM
6 years ago
6 years ago
* [dashboard](dashboard.md) - dashboard for the system's real-time data
* [thread](thread.md) - show java thread information
* [jvm](jvm.md) - show JVM information
* [sysprop](sysprop.md) - show/modify system properties
* **New!** [getstatic](getstatic.md) :clap: - examine class's static properties
6 years ago
6 years ago
## class/classloader
6 years ago
6 years ago
* [sc](sc.md) - check the info for the classes loaded by JVM
* [sm](sm.md) - check methods info for the loaded classes
* [dump](dump.md) - dump the loaded classes in byte code to the specified location
* [redefine](redefine.md) - load external `*.class` files and re-define it into JVM
6 years ago
* [jad](jad.md) - de-compile the specified loaded classes
6 years ago
* [classloader](classloader.md) - check the inheritance structure, urls, class loading info for the specified class; using classloader to get the url of the resource e.g. `java/lang/String.class`
6 years ago
## monitor/watch/trace - related
6 years ago
> **Attention**: commands here are taking advantage of byte-code-injection, which means we are injecting some [aspects](https://en.wikipedia.org/wiki/Aspect-oriented_programming) into the current classes for monitoring and statistics purpose. Therefore when use it for online troubleshooting in your production environment, you'd better **explicitly specify** classes/methods/criteria, and remember to remove the injected code by `shutdown` or `reset`.
6 years ago
6 years ago
* [monitor](monitor.md) - monitor method execution statistics
* [watch](watch.md) - display the input/output parameter, return object, and thrown exception of specified method invocation
* [trace](trace.md) - trace the execution time of specified method invocation
* [stack](stack.md) - display the stack trace for the specified class and method
* [tt](tt.md) - time tunnel, record the arguments and returned value for the methods and replay
6 years ago
## options
6 years ago
* [options](options.md) - check/set Arthas global options
6 years ago
## pipe
6 years ago
Arthas provides `pipe` to process the result returned from commands further, e.g. `sm org.apache.log4j.Logger | grep <init>`. Commands supported in `pipe`:
6 years ago
6 years ago
* grep - filter the result with the given keyword
6 years ago
* plaintext - remove the color
6 years ago
* wc - count lines
6 years ago
## async in background
6 years ago
[async](async.md) can be handy when a problem is hardly to reproduce in the production environment, e.g. one `watch` condition may happen only once in one single day.
6 years ago
6 years ago
* job control - use `>` to redirect result into the log file, use `&` to put the job to the background. Job keeps running even if the session is disconnected (the session lifecycle is 1 day by default)
6 years ago
* jobs - list all jobs
* kill - forcibly terminate the job
6 years ago
* fg - bring the suspend job to the foreground
* bg - put the job to run in the background
## Web Console
Arthas supports living inside a browser. The communication between arthas and browser is via websocket.
* [Web Console](web-console.md)
6 years ago
6 years ago
## Other features
6 years ago
6 years ago
* [Async support](async.md)
6 years ago
* [log the output](save-log.md)
* [batch](batch-support.md)
* [how to use ognl](https://github.com/alibaba/arthas/issues/11)