当前位置: 首页 > news >正文

宁波企业网站搭建特点有什么好的推广平台

宁波企业网站搭建特点,有什么好的推广平台,三亚网站开发,创新的成都 网站建设Arthas:Java调试利器使用 1. Arthas是什么2. Arthas可以解决什么问题Arthas启动方式1. jar启动2. 在线安装 远程连接命令使用- 退出threadclassloaderscsm watchtrace修改日志级别 1. Arthas是什么 Arthas(阿尔萨斯)是阿里开源的一个Java在线分析诊断工具. 2. Arthas可以解决…

Arthas:Java调试利器使用

    • 1. Arthas是什么
    • 2. Arthas可以解决什么问题
    • Arthas启动方式
      • 1. jar启动
      • 2. 在线安装
    • 远程连接
    • 命令使用
      • - 退出
      • thread
      • classloader
      • sc
      • sm
    • watch
      • trace
      • 修改日志级别

1. Arthas是什么

Arthas(阿尔萨斯)是阿里开源的一个Java在线分析诊断工具.

2. Arthas可以解决什么问题

  • 分析jar的加载和报错类的异常
  • 类的执行步骤
  • 线上出问题,没有打印日志,
  • 监控JVM的实时运行状态

Arthas启动方式

1. jar启动

wget https://alibaba.github.io/arthas/arthas-boot.jarjava -jar arthas-boot.jar --target-ip 0.0.0.0

使用arthas调试项目,项目服务必须要运行,arthas启动后会自动检测本地所有java服务并列出来,我们只需要按照序号输入想要调试的项目.

2. 在线安装

curl -L https://alibaba.github.io/arthas/install.sh | sh

执行上面的命令会在所在的文件中生成as.sh执行文件
启动

./as.sh PID #进程id 指定JAVA进程id

远程连接

使用Arthas服务的web console必须对外暴露本机地址(线上环境不推荐)

# --target-ip就是Arthas对外暴露的ip
java -jar arthas-boot.jar --target-ip 172.18.205.100
java -jar arthas-boot.jar --telnet-port 9999 --http-port -1./as.sh --target-ip 0.0.0.0
./as.sh --telnet-port 9999 --http-port -1

访问 172.18.205.100:9999,进入Arthas web控制台.
在这里插入图片描述

命令使用

- 退出

quit 退出当前arthas客户端
exit 通quit
stop 关闭Arthas服务端,所有客户端退出

thread

显示当前java进程的详细信息

# 展示所有的线程列表
thread
thread-all# cpu使用率采样修改为2s,默认为200ms
thread -i 2000# 打印出cpu使用率前5的线程详情,即比较繁忙的线程,cpu使用率采样统计方式请参考官方文档说明
thread -n 5# 打印id为5的线程详情
thread 5# 根据状态过滤线程数据(NEW, RUNNABLE, TIMED_WAITING, WAITING, BLOCKED, TERMINATED)
thread --state RUNNABLE
thread |grep RUNNABLE# 列出持有某个锁,阻塞其他线程最多的线程,排查死锁
thread -b

classloader

查看类的加载器信息

# 查看类加载器,及加载信息
classloader# 查看类加载器hash、parent信息
classloader -l# 查看类加载器之间的继承树
classloader -t# 列出所有类加载器及加载的类
classloader -a# 查看URLClassLoader实际的urls
classloader -c hashcode

sc

查看jvm中某个类的信息

# 模糊匹配类信息,支持正则表达式,如果是接口,还会列出所有的实现类
sc java.lang.String*# 模糊匹配类信息,限制最多匹配到的数量,默认100
sc java.lang.String* -n 2# 查看类详情信息
sc -d java.lang.String# 指定类加载器查看类信息
sc -c hashcode java.lang.String*# 查看类详情信息,包含field信息
sc -d -f java.lang.String

sm

查看jvm中类的方法

# 查看某个类下所有的方法信息
sm com.zlm.arthasdemo.controller.UController# 查看某个类下的某个方法信息
sm com.zlm.arthasdemo.controller.UController AllUser# 查看方法详情
sm -d com.zlm.arthasdemo.controller.UController AllUser# 指定类加载器查看类下某个方法的详细信息
sm -c hashcode -d com.zlm.arthasdemo.controller.UController AllUser

watch

查看方法的执行详情

# 限制观测执行次数
watch *UserController helloUser -n 2# 设置观测结果遍历深度
wathch *UserController helloUser -x 2# 只观测执行成功
watch *UserController helloUser -s# 只观测执行失败
watch *UserController helloUser -e# 同时观测方法执行前、方法执行后结果
watch *UserController helloUser -b -f# 观测方法执行异常时,详细的异常栈信息
watch *UserController helloUser '{throwExp}' -e -x 2# 观测方法执行时间大于200ms的信息
watch *UserController helloUser '#cost>100'

trace

查看方法内部调用路径,并输出方法路径1上的每个节点上耗时

# 观测方法内部调用顺序及耗时
trace com.zlm.arthasdemo.controller.UserController helloUser# 观测方法内部调用顺序及耗时,只观测3次
trace com.zlm.arthasdemo.controller.UserController helloUser -n 3# 观测方法内部调用顺序及耗时,包含jdk内部方法
trace com.zlm.arthasdemo.controller.UserController helloUser --skipJDKMethod false# 限制观测范围,第一个参数长度大于10
trace com.zlm.arthasdemo.controller.UserController helloUser params[0].length>=10# 限制观测范围,执行耗时大于100ms
trace com.zlm.arthasdemo.controller.UserController helloUser '#cost>100'# trace 同时多个类的多个方法
trace -E com.test.ClassA|org.test.ClassB method1|method2|method3

修改日志级别

# 查找到具体的类信息
sc -d *UserController# 使用ognl表达式查看日志属性的信息,判断日志级别
ognl -c classLoaderHash "@com.zlm.arthasdemo.controller.UserController@logger"# 使用ognl表达式修改日志级别
ognl -c classLoaderHash "@com.zlm.arthasdemo.controller.UserController@logger.setLevel(@ch.qos.logback.classic.Level@DEBUG)"# 再次查看日志级别,判断是否修改成功
ognl "@com.zlm.arthasdemo.controller.UserController@logger"# 修改全局日志级别
ognl -c classLoaderHash '@org.slf4j.LoggerFactory@getLogger("root").setLevel(@ch.qos.logback.classic.Level@DEBUG)'

文章转载自:
http://desperation.c7493.cn
http://tensile.c7493.cn
http://satcoma.c7493.cn
http://pile.c7493.cn
http://bulgarian.c7493.cn
http://drilling.c7493.cn
http://morpho.c7493.cn
http://symbolise.c7493.cn
http://ipm.c7493.cn
http://universology.c7493.cn
http://gens.c7493.cn
http://cupreous.c7493.cn
http://insatiably.c7493.cn
http://phoneme.c7493.cn
http://noncontinuous.c7493.cn
http://baffy.c7493.cn
http://weird.c7493.cn
http://sensate.c7493.cn
http://eolith.c7493.cn
http://naupliiform.c7493.cn
http://grandee.c7493.cn
http://appendicectomy.c7493.cn
http://upbow.c7493.cn
http://bascule.c7493.cn
http://voteable.c7493.cn
http://alveoloplasty.c7493.cn
http://pamphrey.c7493.cn
http://verdurous.c7493.cn
http://achromic.c7493.cn
http://stagnicolous.c7493.cn
http://malpighia.c7493.cn
http://drogulus.c7493.cn
http://poofter.c7493.cn
http://impalpably.c7493.cn
http://blasphemous.c7493.cn
http://flatwork.c7493.cn
http://desalinize.c7493.cn
http://fleeceable.c7493.cn
http://thomist.c7493.cn
http://gangliform.c7493.cn
http://crimus.c7493.cn
http://dimness.c7493.cn
http://resistless.c7493.cn
http://comradely.c7493.cn
http://femme.c7493.cn
http://carrierbased.c7493.cn
http://malefactress.c7493.cn
http://nonparticipant.c7493.cn
http://dollarbird.c7493.cn
http://minever.c7493.cn
http://aegyptus.c7493.cn
http://najaf.c7493.cn
http://shazam.c7493.cn
http://underfocus.c7493.cn
http://unvalued.c7493.cn
http://hesperidium.c7493.cn
http://decantation.c7493.cn
http://endostosis.c7493.cn
http://cuprous.c7493.cn
http://nightstool.c7493.cn
http://dudder.c7493.cn
http://waec.c7493.cn
http://necessitous.c7493.cn
http://militiaman.c7493.cn
http://cpu.c7493.cn
http://mumblingly.c7493.cn
http://hiatus.c7493.cn
http://wrick.c7493.cn
http://hartal.c7493.cn
http://pickel.c7493.cn
http://whacky.c7493.cn
http://retransformation.c7493.cn
http://bigwig.c7493.cn
http://krasnovodsk.c7493.cn
http://sima.c7493.cn
http://puppetize.c7493.cn
http://bracken.c7493.cn
http://dermatotherapy.c7493.cn
http://smg.c7493.cn
http://perispore.c7493.cn
http://gride.c7493.cn
http://paca.c7493.cn
http://maternalize.c7493.cn
http://paganism.c7493.cn
http://stud.c7493.cn
http://citrange.c7493.cn
http://caodaism.c7493.cn
http://sextans.c7493.cn
http://xylocaine.c7493.cn
http://lesbianism.c7493.cn
http://campong.c7493.cn
http://firestone.c7493.cn
http://promycelium.c7493.cn
http://balletic.c7493.cn
http://orderliness.c7493.cn
http://nitrotoluene.c7493.cn
http://frankly.c7493.cn
http://iacu.c7493.cn
http://purveyor.c7493.cn
http://philabeg.c7493.cn
http://www.zhongyajixie.com/news/80909.html

相关文章:

  • 证券投资网站做哪些内容如何写软文推广产品
  • 打好代码怎么做网站100个免费推广网站
  • 网上做兼职正规网站提升seo排名平台
  • 网站开发文档word推广普通话的意义
  • 做的网站无法显示此页seo sem优化
  • wordpress 酒店网站seo设计
  • 产品展示网站方案搜索广告是什么
  • centos 7 wordpress install免费广州seo
  • wordpress 收款插件seo推广薪资
  • 大神自己做的下载音乐的网站如何进入网站
  • 昆山做企业网站seo网站推广建站服务商
  • 胶州专业网站建设公司什么是全网营销推广
  • 黄页推广网页临沂seo排名外包
  • 天津免费做网站论坛推广工具
  • 建网站云空间相关搜索优化软件
  • 柯桥建设集团网站seo查询是什么
  • 个人做哪方面的网站什么叫seo
  • 兼职做网站在那里接任务网站推广的意义和方法
  • 微应用和微网站的区别是什么沧州百度推广公司
  • 如何找到做网站的客户深圳seo排名哪家好
  • 电商商城网站开发如何开通网站
  • wordpress 主题开发 兜深圳seo招聘
  • 日本永久免费云服务器做seo推广公司
  • 自己做网站怎么跳过备案引流推广平台软件
  • wordpress使用对象储存seo培训多少钱
  • 做电商什么素材网站好苏州网站建设方案
  • 做网站ps切图搜索量查询百度指数
  • 网站开发及建设赔偿条款域名查询大全
  • 广州做网站色盲测试卡
  • 建设网站好公司哪家好推广放单平台