## Arthas
![arthas](site/docs/.vuepress/public/images/arthas.png)
[![Build Status](https://github.com/alibaba/arthas/workflows/JavaCI/badge.svg)](https://github.com/alibaba/arthas/actions)
[![codecov](https://codecov.io/gh/alibaba/arthas/branch/master/graph/badge.svg)](https://codecov.io/gh/alibaba/arthas)
[![maven](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg)](https://search.maven.org/search?q=g:com.taobao.arthas)
![license](https://img.shields.io/github/license/alibaba/arthas.svg)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Percentage of issues still open")
[![Leaderboard](https://img.shields.io/badge/Arthas-Check%20Your%20Contribution-orange)](https://opensource.alibaba.com/contribution_leaderboard/details?projectValue=arthas)
`Arthas` is a Java Diagnostic tool open sourced by Alibaba.
Arthas allows developers to troubleshoot production issues for Java applications without modifying code or restarting servers.
[中文说明/Chinese Documentation](README_CN.md)
### Background
Often times, the production system network is inaccessible from the local development environment. If issues are encountered in production systems, it is impossible to use IDEs to debug the application remotely. More importantly, debugging in production environment is unacceptable, as it will suspend all the threads, resulting in the suspension of business services.
Developers could always try to reproduce the same issue on the test/staging environment. However, this is tricky as some issues cannot be reproduced easily on a different environment, or even disappear once restarted.
And if you're thinking of adding some logs to your code to help troubleshoot the issue, you will have to go through the following lifecycle; test, staging, and then to production. Time is money! This approach is inefficient! Besides, the issue may not be reproducible once the JVM is restarted, as described above.
Arthas was built to solve these issues. A developer can troubleshoot your production issues on-the-fly. No JVM restart, no additional code changes. Arthas works as an observer, which will never suspend your existing threads.
### Key features
* Check whether a class is loaded, or where the class is being loaded. (Useful for troubleshooting jar file conflicts)
* Decompile a class to ensure the code is running as expected.
* View classloader statistics, e.g. the number of classloaders, the number of classes loaded per classloader, the classloader hierarchy, possible classloader leaks, etc.
* View the method invocation details, e.g. method parameter, return object, thrown exception, and etc.
* Check the stack trace of specified method invocation. This is useful when a developers wants to know the caller of the said method.
* Trace the method invocation to find slow sub-invocations.
* Monitor method invocation statistics, e.g. qps, rt, success rate and etc.
* Monitor system metrics, thread states and cpu usage, gc statistics, and etc.
* Supports command line interactive mode, with auto-complete feature enabled.
* Supports telnet and websocket, which enables both local and remote diagnostics with command line and browsers.
* Supports profiler/Flame Graph
* Support get objects in the heap that are instances of the specified class.
* Supports JDK 6+.
* Supports Linux/Mac/Windows.
### [Online Tutorials(Recommended)](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en)
* [Usages](tutorials/katacoda/README.md#online-tutorial-usages)
### Quick start
#### Use `arthas-boot`(Recommended)
Download`arthas-boot.jar`,Start with `java` command:
```bash
curl -O https://arthas.aliyun.com/arthas-boot.jar
java -jar arthas-boot.jar
```
Print usage:
```bash
java -jar arthas-boot.jar -h
```
#### Use `as.sh`
You can install Arthas with one single line command on Linux, Unix, and Mac. Copy the following command and paste it into the command line, then press *Enter* to run:
```bash
curl -L https://arthas.aliyun.com/install.sh | sh
```
The command above will download the bootstrap script `as.sh` to the current directory. You can move it any other place you want, or put its location in `$PATH`.
You can enter its interactive interface by executing `as.sh`, or execute `as.sh -h` for more help information.
### Documentation
* [Online Tutorials(Recommended)](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en)
* [User manual](https://arthas.aliyun.com/doc/en)
* [Installation](https://arthas.aliyun.com/doc/en/install-detail.html)
* [Download](https://arthas.aliyun.com/doc/en/download.html)
* [Quick start](https://arthas.aliyun.com/doc/en/quick-start.html)
* [Advanced usage](https://arthas.aliyun.com/doc/en/advanced-use.html)
* [Commands](https://arthas.aliyun.com/doc/en/commands.html)
* [WebConsole](https://arthas.aliyun.com/doc/en/web-console.html)
* [Docker](https://arthas.aliyun.com/doc/en/docker.html)
* [Arthas Spring Boot Starter](https://arthas.aliyun.com/doc/en/spring-boot-starter.html)
* [User cases](https://github.com/alibaba/arthas/issues?q=label%3Auser-case)
* [FAQ](https://arthas.aliyun.com/doc/en/faq)
* [Compile and debug/How to contribute](https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md)
* [Release Notes](https://github.com/alibaba/arthas/releases)
### Feature Showcase
#### Dashboard
* https://arthas.aliyun.com/doc/en/dashboard
![dashboard](site/docs/.vuepress/public/images/dashboard.png)
#### Thread
* https://arthas.aliyun.com/doc/en/thread
See what is eating your CPU (ranked by top CPU usage) and what is going on there in one glance:
```bash
$ thread -n 3
"as-command-execute-daemon" Id=29 cpuUsage=75% RUNNABLE
at sun.management.ThreadImpl.dumpThreads0(Native Method)
at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:440)
at com.taobao.arthas.core.command.monitor200.ThreadCommand$1.action(ThreadCommand.java:58)
at com.taobao.arthas.core.command.handler.AbstractCommandHandler.execute(AbstractCommandHandler.java:238)
at com.taobao.arthas.core.command.handler.DefaultCommandHandler.handleCommand(DefaultCommandHandler.java:67)
at com.taobao.arthas.core.server.ArthasServer$4.run(ArthasServer.java:276)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Number of locked synchronizers = 1
- java.util.concurrent.ThreadPoolExecutor$Worker@6cd0b6f8
"as-session-expire-daemon" Id=25 cpuUsage=24% TIMED_WAITING
at java.lang.Thread.sleep(Native Method)
at com.taobao.arthas.core.server.DefaultSessionManager$2.run(DefaultSessionManager.java:85)
"Reference Handler" Id=2 cpuUsage=0% WAITING on java.lang.ref.Reference$Lock@69ba0f27
at java.lang.Object.wait(Native Method)
- waiting on java.lang.ref.Reference$Lock@69ba0f27
at java.lang.Object.wait(Object.java:503)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
```
#### jad
* https://arthas.aliyun.com/doc/en/jad
Decompile your class with one shot:
```java
$ jad javax.servlet.Servlet
ClassLoader:
+-java.net.URLClassLoader@6108b2d7
+-sun.misc.Launcher$AppClassLoader@18b4aac2
+-sun.misc.Launcher$ExtClassLoader@1ddf84b8
Location:
/Users/xxx/work/test/lib/servlet-api.jar
/*
* Decompiled with CFR 0_122.
*/
package javax.servlet;
import java.io.IOException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public interface Servlet {
public void init(ServletConfig var1) throws ServletException;
public ServletConfig getServletC
没有合适的资源?快使用搜索试试~ 我知道了~
Arthas开源的Java诊断工具.rar
共1992个文件
md:894个
java:592个
png:151个
需积分: 5 1 下载量 40 浏览量
2023-07-13
08:10:25
上传
评论
收藏 9.52MB RAR 举报
温馨提示
介绍 Arthas是一款基于 Java 的开源诊断工具,可以在不修改应用程序源代码的情况下,对生产环境的 Java 应用程序进行快速诊断。它提供了许多强大的命令行工具,可以帮助开发人员实时监控应用程序的运行状态,以及分析和调试 Java 应用程序的性能问题。 下面我们来介绍 Arthas 的基本原理和一些常用命令。 Arthas 的基本原理是使用 Java Agent 实现的,它会在应用程序启动时向 JVM 中注入一个 Java Agent,该 Agent 可以修改字节码,动态地为应用程序增加一些代码。通过这种方式,Arthas 可以在应用程序运行时,动态地获取应用程序的状态,而不需要修改源代码或者重新部署应用程序。 Arthas 提供了丰富的命令行工具,可以实时监控 JVM 的状态,跟踪应用程序的调用链,诊断线程问题等。下面我们列出一些常用的命令: help: 查看帮助信息 jvm: 查看 JVM 信息 classloader: 查看类加载器信息 sc: 查看类的字节码 jad: 查看类的源代码 watch: 实时监控某个方法的调用情况 trace: 跟踪方法调用链
资源推荐
资源详情
资源评论
收起资源包目录
Arthas开源的Java诊断工具.rar (1992个子文件)
arthas.1 3KB
copyright.1 484B
batch.as 130B
as-service.bat 8KB
as.bat 3KB
mvnw.cmd 6KB
control 291B
jni-library.cpp 6KB
main.css 60B
main.css 58B
main.css 58B
libArthasJniLibrary-x64.dll 2.29MB
Dockerfile 930B
Dockerfile-No-Jdk 545B
libArthasJniLibrary.dylib 100KB
.env 58B
spring.factories 184B
.gitignore 452B
.gitignore 261B
.gitignore 47B
verify.groovy 100B
arthas-tutorials.html 32KB
index.html 373B
index.html 373B
index.html 364B
agents.html 316B
apps.html 313B
favicon.ico 17KB
favicon.ico 17KB
inputrc 1KB
maven-wrapper.jar 50KB
ConcurrentWeakKeyHashMap.java 50KB
Telnet.java 33KB
Bootstrap.java 32KB
StringUtils.java 31KB
SocketClient.java 29KB
HttpApiHandler.java 28KB
ClassLoaderCommand.java 27KB
ObjectView.java 26KB
ArthasBootstrap.java 25KB
Enhancer.java 23KB
TelnetInputStream.java 22KB
ProcessImpl.java 21KB
TimeTunnelCommand.java 21KB
ProfilerCommand.java 20KB
ThreadUtil.java 19KB
ReflectUtils.java 19KB
MBeanCommand.java 19KB
ObjectUtils.java 19KB
RetransformCommand.java 18KB
FieldUtils.java 18KB
StringUtilsTest.java 18KB
ProcessUtils.java 16KB
Ansi.java 16KB
JFRCommand.java 16KB
LoggerCommand.java 15KB
TelnetConsole.java 15KB
TunnelSocketFrameHandler.java 14KB
CompletionUtils.java 14KB
ArthasReflectUtils.java 13KB
VmToolCommand.java 13KB
TelnetClient.java 13KB
DirectoryBrowser.java 12KB
ClassUtils.java 12KB
PropertySource.java 11KB
DashboardCommand.java 11KB
JulyCommand.java 11KB
MutablePropertySources.java 11KB
AdviceListenerManager.java 11KB
PropertyPlaceholderHelper.java 10KB
ObjectViewTest.java 10KB
DatagramSocketClient.java 10KB
JadCommand.java 10KB
ShellImpl.java 10KB
JobControllerImpl.java 10KB
ThreadLocalRandom.java 10KB
ShellServerImpl.java 10KB
TableView.java 10KB
EnhancerCommand.java 10KB
MBeanView.java 9KB
OptionsCommand.java 9KB
ThreadCommand.java 9KB
GetStaticCommand.java 9KB
JvmCommand.java 9KB
MonitorAdviceListener.java 9KB
TelnetOptionHandler.java 9KB
DumpClassCommand.java 9KB
FileUtils.java 8KB
TraceView.java 8KB
JobImpl.java 8KB
VmToolTest.java 8KB
Arthas.java 8KB
AbstractPropertyResolver.java 8KB
TreeView.java 8KB
SearchMethodCommand.java 8KB
DefaultSocketFactory.java 8KB
TimeTunnelTable.java 8KB
ClassLoaderView.java 8KB
SessionManagerImpl.java 8KB
TermImpl.java 8KB
共 1992 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
野生的大熊
- 粉丝: 230
- 资源: 247
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功