reset命令

重置增强类,将被 Arthas 增强过的类全部还原,Arthas 服务端stop/shutdown时会重置所有增强过的类

使用参考

  1. $ reset -h
  2. USAGE:
  3. reset [-h] [-E] [class-pattern]
  4. SUMMARY:
  5. Reset all the enhanced classes
  6. EXAMPLES:
  7. reset
  8. reset *List
  9. reset -E .*List
  10. OPTIONS:
  11. -h, --help this help
  12. -E, --regex Enable regular expression to match (wildcard matching by default)
  13. <class-pattern> Path and classname of Pattern Matching

还原指定类

  1. $ trace Test test
  2. Press Ctrl+C to abort.
  3. Affect(class-cnt:1 , method-cnt:1) cost in 57 ms.
  4. `---ts=2017-10-26 17:10:33;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@14dad5dc
  5. `---[0.590102ms] Test:test()
  6. `---ts=2017-10-26 17:10:34;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@14dad5dc
  7. `---[0.068692ms] Test:test()
  8. $ reset Test
  9. Affect(class-cnt:1 , method-cnt:0) cost in 11 ms.

还原所有类

  1. $ trace Test test
  2. Press Ctrl+C to abort.
  3. Affect(class-cnt:1 , method-cnt:1) cost in 15 ms.
  4. `---ts=2017-10-26 17:12:06;thread_name=main;id=1;is_daemon=false;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@14dad5dc
  5. `---[0.128518ms] Test:test()
  6. $ reset
  7. Affect(class-cnt:1 , method-cnt:0) cost in 9 ms.