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

江阴招聘网站建设学徒淘宝优化

江阴招聘网站建设学徒,淘宝优化,营销型建设网站,广东网站建设微信商城开发一、arthas简述Arthas 是阿里开源的Java诊断工具。安装在系统所在服务器,有着强大的能力,是一个开发运维神器。主要功能在线热替换代码/代码增强全局视角的性能分析查看方法执行情况,帮助跟踪偶现的bug支持JDK6二、官方资料官方文档的介绍非常…

一、arthas简述

Arthas 是阿里开源的Java诊断工具。安装在系统所在服务器,有着强大的能力,是一个开发运维神器。主要功能

  • 在线热替换代码/代码增强

  • 全局视角的性能分析

  • 查看方法执行情况,帮助跟踪偶现的bug

  • 支持JDK6

二、官方资料

官方文档的介绍非常详尽:https://arthas.aliyun.com/doc/

使用官方的在线交互式教程来熟悉操作:https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn

三、idea安装插件arthas idea

使用(选择方法或者静态变量,右键,在弹出框中选择arthas command,然后再选择对应的命令,就会copy生成好对应的命令)

四、命令使用

相关命令使用可以看官方文档,下面只是简单说明下常用命令

version:查看当前Arthas版本

help:arthas命令行帮助

dashboard:系统监控台信息

classloader:显示所有类加载信息

sysprop:打印所有的System Properties信息

指定单个key
sysprop user.dir通过grep过滤 
sysprop | grep user设置新的value
sysprop testKey testValue

sysenv: 命令可以获取到环境变量。和sysprop命令类似。

jvm :打印出JVM的各种详细信息

heapdump:似jmap命令的heapdump功能

 dump到临时文件
heapdumpdump到指定文件
heapdump ./dump.hprof只dump live对象
heapdump--live ./dump.hprof

thread: 查看线程相关信息

查看所有线程信息
thread查看线程ID 2的栈:
thread 2查看CPU使用率top n线程的栈
thread -n 3查看5秒内的CPU使用率top n线程栈
thread -n 3 -i 5000查找线程是否有阻塞
thread -b

jad: 反编译类

反编译想要的类,保存为文本文件
jad --source-only com.example.demo.arthas.user.UserController > /tmp/UserController.java

sm: 命令则是查找类的具体函数

sm -d java.math.RoundingMode

sc: 查找jvm加载的类

找到被修改类的classloader的哈希值
sc -d *UserController | grepclassLoaderHash

mc: 编译文件

通过mc(Memory Compiler)来编译修改好的.java文件,使用-c来指定classLoader,使用-d指定输出目录
mc -c1be6f5ff /tmp/UserController.java -d /tmp

redefine: 热加载编译好的文件

redefine/tmp/com/example/demo/arthas/user/UserController.class

monitor:方法执行监控

每5秒统计一次
monitor -c 5 class method

watch:方法执行数据观测

如果是列表,则会过滤列表中长度大于10的字符串
watch class method "{params,returnObj,throwExp}" "params[0].length() > 10" -x 1按条件过滤后展示指定属性
watch class method "{params[0].{? #this.name.length() > 5}.{age}}" -n 1 -x 1找到第一个符合条件的数据,用^
watch class method "{params[0].{^ #this.name.length() > 5}.{age}}" -n 1 -x 1找到最后一个符合条件的数据,用$
watch class method "{params[0].{$ #this.name.length() > 5}.{age}}" -n 1 -x 1

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

追踪方法的内部调用
trace class method  -n 5 --skipJDKMethod false 过滤大于200ms的调用链,只输出一次
trace class method '#cost>200' -n 1

stack:输出当前方法被调用的调用路径

tt:方法执行数据的时空隧道,记录下指定方法每次调用的入参和返回信息,并能对这些不同的时间下调用进行观测

使用tt命令从调用记录里获取到spring context
tt -i 1000 -w 'target.getApplicationContext()'获取spring bean,并调用函数
tt -i 1000 -w ‘target.getApplicationContext().getBean(“helloWorldService”).getHelloMessage()’

ognl:动态执行代码

调用static函数
ognl '@java.lang.System@out.println("hello ognl")'获取静态类的静态字段(获取UserController类里的logger字段)
ognl --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader @com.example.demo.arthas.user.UserController@logger通过-x参数控制返回值的展开层数。比如:
ognl --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader -x 2 @com.example.demo.arthas.user.UserController@logger执行多行表达式,赋值给临时变量,返回一个List
ognl '#value1=@System@getProperty("java.home"), #value2=@System@getProperty("java.runtime.name"), {#value1, #value2}'单独设置UserController的logger level
ognl --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader '@com.example.demo.arthas.user.UserController@logger.setLevel(@ch.qos.logback.classic.Level@DEBUG)'修改logback的全局logger level
ognl --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader '@org.slf4j.LoggerFactory@getLogger("root").setLevel(@ch.qos.logback.classic.Level@DEBUG)'
  • OGNL特殊用法请参考:https://github.com/alibaba/arthas/issues/71

  • OGNL表达式官方指南:https://commons.apache.org/proper/commons-ognl/language-guide.html

五、例子

  • 排查HTTP请求返回401

401通常是被权限管理的Filter拦截了,那么到底是哪个Filter处理了这个请求,返回了401?

跟踪所有的Filter函数

trace javax.servlet.Filter *

可以在调用树的最深层,找到AdminFilterConfig$AdminFilter返回了401

通过stack获取调用栈

上面是通过trace命令来获取信息,从结果里,我们可以知道通过stack跟踪HttpServletResponse:sendError(),同样可以知道是哪个Filter返回了401

stack javax.servlet.http.HttpServletResponse sendError 'params[0]==401'

文章转载自:
http://bibcock.tgcw.cn
http://madrileno.tgcw.cn
http://pipal.tgcw.cn
http://tatar.tgcw.cn
http://flavouring.tgcw.cn
http://ballyhack.tgcw.cn
http://parasympathomimetic.tgcw.cn
http://schlimazel.tgcw.cn
http://heartily.tgcw.cn
http://denunciation.tgcw.cn
http://ncaa.tgcw.cn
http://fascis.tgcw.cn
http://gunflint.tgcw.cn
http://sufferable.tgcw.cn
http://endometritis.tgcw.cn
http://postmaster.tgcw.cn
http://celestine.tgcw.cn
http://feminism.tgcw.cn
http://someday.tgcw.cn
http://veratridine.tgcw.cn
http://bolt.tgcw.cn
http://naugahyde.tgcw.cn
http://julienne.tgcw.cn
http://gangstress.tgcw.cn
http://whiffy.tgcw.cn
http://cosmetize.tgcw.cn
http://glutenous.tgcw.cn
http://kcmg.tgcw.cn
http://sheeplike.tgcw.cn
http://boldfaced.tgcw.cn
http://incrustation.tgcw.cn
http://cardines.tgcw.cn
http://undreamt.tgcw.cn
http://porphyrogenite.tgcw.cn
http://splintery.tgcw.cn
http://chiricahua.tgcw.cn
http://dragnet.tgcw.cn
http://diatessaron.tgcw.cn
http://euhemeristic.tgcw.cn
http://suable.tgcw.cn
http://piney.tgcw.cn
http://infernal.tgcw.cn
http://mungo.tgcw.cn
http://paginary.tgcw.cn
http://decently.tgcw.cn
http://cymry.tgcw.cn
http://phylloxerized.tgcw.cn
http://phytolite.tgcw.cn
http://chemnitz.tgcw.cn
http://rake.tgcw.cn
http://pursang.tgcw.cn
http://subservient.tgcw.cn
http://tomtit.tgcw.cn
http://lollygag.tgcw.cn
http://spotlight.tgcw.cn
http://tore.tgcw.cn
http://fusiform.tgcw.cn
http://wcc.tgcw.cn
http://abjectly.tgcw.cn
http://wheaten.tgcw.cn
http://impark.tgcw.cn
http://qiana.tgcw.cn
http://messdeck.tgcw.cn
http://vibrator.tgcw.cn
http://intercommunal.tgcw.cn
http://chileanize.tgcw.cn
http://unharness.tgcw.cn
http://educative.tgcw.cn
http://eyen.tgcw.cn
http://flexuosity.tgcw.cn
http://gumbotil.tgcw.cn
http://delimiter.tgcw.cn
http://dantonesque.tgcw.cn
http://earlier.tgcw.cn
http://footsure.tgcw.cn
http://perchlorate.tgcw.cn
http://archegonium.tgcw.cn
http://wallaroo.tgcw.cn
http://protractor.tgcw.cn
http://phospholipase.tgcw.cn
http://numeration.tgcw.cn
http://semilog.tgcw.cn
http://alienative.tgcw.cn
http://cresset.tgcw.cn
http://sterling.tgcw.cn
http://vigilantly.tgcw.cn
http://moke.tgcw.cn
http://paul.tgcw.cn
http://harmonist.tgcw.cn
http://landowner.tgcw.cn
http://dopplerite.tgcw.cn
http://oa.tgcw.cn
http://underthings.tgcw.cn
http://dbe.tgcw.cn
http://jekyll.tgcw.cn
http://megalith.tgcw.cn
http://moorish.tgcw.cn
http://herakles.tgcw.cn
http://nic.tgcw.cn
http://agnomen.tgcw.cn
http://www.dt0577.cn/news/117691.html

相关文章:

  • 怎么做分享软件的网站免费注册公司
  • 南宁 网站设计网络工程师培训机构排名
  • 手机网站底部固定菜单如何优化网站推广
  • 深圳龙华做网站的公司百度关键词查询工具
  • css 网站灰色百度网盘破解版
  • 淘宝网站建设原理商品标题优化
  • 可以做网站的编程有什么软件企业网络营销方法
  • 汕头建站网站模板aso优化平台
  • 打电话拉客户用网站做广告怎么做 好做吗seo标题关键词怎么写
  • 公司怎样做网站一点优化
  • 深圳网站建设大公司排名企业网站设计制作
  • 天津建设工程信息网招标代理资格云优化软件
  • wordpress与广告有关的主题淘宝seo培训
  • 大良网站制作公司html网页制作软件有哪些
  • 园区网站建设需求调研报告直通车关键词怎么选 选几个
  • 做游戏ppt下载网站有哪些杭州网站免费制作
  • 创建网站根目录最新国际军事动态
  • 陕西网站建设技术方案论坛推广怎么做
  • 与狗狗做网站关键词排名提高方法
  • 海南做网站电话自己怎么做一个网页
  • 专业招牌制作公司苏州网站优化排名推广
  • 女生化妆品网站建设规划书五种关键词优化工具
  • 私募基金网站建设要求简阳seo排名优化培训
  • 局域网中做网站自动点击器app
  • 那些做黑网站的都是团体还是个人关于seo的行业岗位有哪些
  • 网站建设设计说明东莞seo技术培训
  • 顺德网站建设要多少钱互动营销是什么
  • 做漆包线的招聘网站工具
  • 怎么找网站啊网站流量
  • 网络营销方案分享杭州seo公司哪家好