vipshop / vjtools Goto Github PK
View Code? Open in Web Editor NEWThe vip.com's java coding standard, libraries and tools
License: Apache License 2.0
The vip.com's java coding standard, libraries and tools
License: Apache License 2.0
很多时候,JVM自动回收腊鸡是件美好的事情,但是在业务高峰的时候偏偏发现老年代已经接近触发CMS阀值,就有点让人焦躁了吧?我们为什么不在流量低谷的时候主动清扫下内存里面无用的老家伙们呢? | Garbage collection is a good thing, JVM will do most of the dirty stuff for us. But when our system is at its peak moment and is making millions of dollars every second, we might get frustrated to see the garbage collector is yelling to "stop-the-world". Why don't we do it more proactively, for example, try to trigger a GC when our system is snoring?
调整README内容
PropertiesUtil.loadFromFile():注释为:路径支持从外部文件或resources文件加载, "file://"或无前缀代表外部文件, "classpath://"代表resources;
当实际上URLResourceUtil.asStream(generalPath)用的是classpath: 非classpath://
是否有考虑过增加PMD规则,公司内部基于git服务端hook对提交代码通过PMD进行代码规范检测,sonar-runner貌似对这种支持不太好
用于VJMap的统计信息还不足以判断问题,需要完整HeapDump下来,用MAT打开后,使用OQL按内存地址段过滤老生代对象。
一般应用默认没有打开-XX:+PrintHeapAtGC ,因此支持用vjmap来获取。并支持独立参数来打印它。
编译执行的,难道是我的使用方式或者环境不对吗?白衣大人
vjmap
[root@qa-admin vjmap]# ./vjmap.sh -all 5111
WARNING!! STW(Stop-The-World) will be performed on your Java process, if this is NOT wanted, type 'Ctrl+C' to exit.
sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.111-b14. Target VM is 25.161-b14
[root@qa-admin vjmap]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
vjtop
root@qa-admin vjtop]# ./vjtop.sh 5111
六月 20, 2018 5:43:49 下午 com.vip.vjtools.vjtop.VMInfo processNewVM
严重: could not attach (PID=5111)
java.io.IOException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at com.vip.vjtools.vjtop.data.jmx.JmxClient.getConnectorAddress(JmxClient.java:254)
at com.vip.vjtools.vjtop.data.jmx.JmxClient.tryConnect(JmxClient.java:112)
at com.vip.vjtools.vjtop.data.jmx.JmxClient.connect(JmxClient.java:102)
at com.vip.vjtools.vjtop.VMInfo.processNewVM(VMInfo.java:132)
at com.vip.vjtools.vjtop.VMDetailView.(VMDetailView.java:44)
at com.vip.vjtools.vjtop.VJTop.main(VJTop.java:88)
Caused by: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.LinuxVirtualMachine.(LinuxVirtualMachine.java:106)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
at com.vip.vjtools.vjtop.data.jmx.JmxClient.getConnectorAddress(JmxClient.java:252)
... 5 more
ERROR: Could not attach to process.
为兼容JDK8,取消掉class来源于哪个jar文件的打印
从该项目中获取了很多开发上的规范,但是对于经验不那么丰富的人而言,前后端规范方面也是比较欠缺的。
不知道项目组是否有计划进行前后端规范的整理以及开源发布之类?
谢谢
将丢失的optional 和 scope=test 补回去
体验类似top的排序切换 和 help
白衣大神,看 vjkit 的时候还在想出于什么考虑选用了用 Dozer,后来在 BeanMapper 的注释看到了这句话:
orika性能更好,也不需要Getter函数与无参构造函数,但有潜在bug还没在社区版修复
请问是啥 bug?我目前正在使用 Orika,并且基于 Orika 封装了一个工具 Copiers,想看下对我有没有影响。
heap is bigger than 8G normally and takes long time&big disk to dump a whole one, expect an option to dump old generation only.
best wish!
交互类似Top
PS. 像Kotlin这种NullSafe语言太有爱了。
打印每一个年龄的总对象数量及总大小
Hi Team,
我很喜欢 vjtop 最新添加的交互式操作,这让 vjtop 更加贴近 top 命令
不过我感觉在输入指令后还要按回车实在不够“Geek”
我在网上搜索以后,找到了下面这篇博客提到了可以实现更加贴近 top 的命令输入方式:
Non blocking console input in Python and Java
不过博客中提到的方法只适用于 Linux,Windows 需要引入额外的包
不知道 vjtools team 有没有兴趣研究一下
LongAddr类中的Cell类中的填充属性会不会被jdk给优化掉了?
这个经过测试没有?
Hello,
有个问题想请教,每个模块例如vjkit,vjmap都是独立的功能,我的理解独立成项目可以更好的维护(issue,fix,patch等)。
jinfo -flags, jmap -heap
滑动窗口计数器的需求广泛,但缺少一个高性能,低并发锁,低内存开销的实现。
Rule 12. 【推荐】Array 与 List互转的正确写法
两种Array转换List,错误和正确的代码范例:
// array -> list List list = Arrays.asList(array); //WRONG List list = new ArrayList(array); //RIGHT
其中正确的方式:List list = new ArrayList(array)
ArrayList的构造函数有三种:无参数、一个参数:容量、一个参数:Collection<? extends E>
没有可供直接传数组的构造方法
vjtop目前会默认把所有线程都统计在一起。有时候只需要关注某些特定的线程,因此建议可以根据关键字模糊匹配线程名,只显示匹配上的线程信息出来
vjmap文档概述里面
分代版的jmap(新生代,存活区,老生代),是排查内存缓慢泄露,老生代增长过快原因的利器。因为jmap -histo PID 打印的是整个Heap的对象统计信息,而为了定位上面的问题,我们需要专门查看OldGen对象,和Survivor区老龄剩男的工具。
和Survivor区老龄剩男的工具这个剩男是不是笔误?
如果CPU核数是物理机的,会造成GC线程数,Netty默认线程数等过大的问题。
已使用SonarCloud提供的Sonar服务,在公司内部的Jenkins每晚进行扫描。
https://sonarcloud.io/dashboard?id=com.vip.vjtools:vjkit
可惜扫描规则只能使用默认的Sonar way
如果输入指令不按下回车确认,这个指令会在下次打印信息的时候被刷掉
被刷掉后再按下回车确认,这个指令仍然能够被正确读取
such as: junit, assertj-core, mockito-core
https://github.com/vipshop/vjtools/blob/master/docs/standard/ali.md
(一) 命名规约
VIP 规范
8. 命名命名的好坏,在于其“模糊度”
此处命名命名应该删掉一个命名。
我不pull requests 了,大佬自己改吧。
在jmxcli上二次开发
支持当原应用未打开jmx端口时,能够直接通过pid 连接进去。
当jstat不能使用时,完全模拟jstat -gcutil的输出
并稍微加强开发/使用过程的README说明
具体报错信息如下:
七月 14, 2018 10:19:40 下午 com.vip.vjtools.vjtop.VMInfo update
信息: error during update
java.lang.NullPointerException
at com.vip.vjtools.vjtop.VMInfo.updateMemoryPool(VMInfo.java:312)
at com.vip.vjtools.vjtop.VMInfo.update(VMInfo.java:224)
at com.vip.vjtools.vjtop.VMDetailView.printView(VMDetailView.java:54)
at com.vip.vjtools.vjtop.VJTop.run(VJTop.java:192)
at com.vip.vjtools.vjtop.VJTop.main(VJTop.java:120)
ERROR: Could not fetch telemetries - Process terminated?
只打印线程名,不打印stacktrace,不会造成阻塞。
目前覆盖率80%,已使用SonarCloud提供的Sonar服务
https://vipshop.github.io/vjtools/#/standard/chapter03
应该是代码格式化语法没写好
upgrade from 1.x to 2.x
1 SlidingWindow for time
2 SlidingWindow for request
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.