mirror of https://github.com/alibaba/arthas.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
15 KiB
JavaScript
62 lines
15 KiB
JavaScript
import{_ as a,o,c as l,a as e,b as t,e as n,d as i,r as c}from"./app.977e81c1.js";const r={},d=e("h1",{id:"options",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#options","aria-hidden":"true"},"#"),n(" options")],-1),u={href:"https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-options",target:"_blank",rel:"noopener noreferrer"},p=e("code",null,"options",-1),h=n(" online tutorial"),m=e("div",{class:"custom-container tip"},[e("p",{class:"custom-container-title"},"TIP"),e("p",null,"Global options")],-1),b=e("thead",null,[e("tr",null,[e("th",null,"Name"),e("th",null,"Default Value"),e("th",null,"Description")])],-1),v=e("tr",null,[e("td",null,"unsafe"),e("td",null,"false"),e("td",null,"whether to enhance to system-level class. Use it with caution since JVM may hang")],-1),f=e("tr",null,[e("td",null,"dump"),e("td",null,"false"),e("td",null,[n("whether to dump enhanced class to the external files. If it's on, enhanced class will be dumped into "),e("code",null,"/${application dir}/arthas-class-dump/"),n(", the specific output path will be output in the console")])],-1),g=e("tr",null,[e("td",null,"batch-re-transform"),e("td",null,"true"),e("td",null,"whether to re-transform matched classes in batch")],-1),k=e("tr",null,[e("td",null,"json-format"),e("td",null,"false"),e("td",null,"whether to output in JSON format")],-1),_=e("tr",null,[e("td",null,"disable-sub-class"),e("td",null,"false"),e("td",null,[n("whether to enable matching child classes. The default value is "),e("code",null,"true"),n(". If exact match is desire, turn off this flag")])],-1),w=e("td",null,"support-default-method",-1),x=e("td",null,"true",-1),j=n("whether to enable matching default method in interface. The default value is "),y=e("code",null,"true",-1),T=n(". Refer to "),E={href:"https://github.com/alibaba/arthas/issues/1105",target:"_blank",rel:"noopener noreferrer"},O=n("#1105"),A=e("tr",null,[e("td",null,"save-result"),e("td",null,"false"),e("td",null,[n("whether to save execution result. All execution results will be saved to "),e("code",null,"~/logs/arthas-cache/result.log"),n(" when it's turned on")])],-1),V=e("tr",null,[e("td",null,"job-timeout"),e("td",null,"1d"),e("td",null,"default timeout for background jobs. Background job will be terminated once it's timed out (i.e. 1d, 2h, 3m, 25s)")],-1),I=e("tr",null,[e("td",null,"print-parent-fields"),e("td",null,"true"),e("td",null,"This option enables print files in parent class, default value true.")],-1),N=e("tr",null,[e("td",null,"verbose"),e("td",null,"false"),e("td",null,"This option enables print verbose information")],-1),S=e("tr",null,[e("td",null,"strict"),e("td",null,"true"),e("td",null,"whether to enable strict mode")],-1),M=i(`<h2 id="view-all-options" tabindex="-1"><a class="header-anchor" href="#view-all-options" aria-hidden="true">#</a> View all options</h2><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ options
|
|
LEVEL TYPE NAME VALUE SUMMARY DESCRIPTION
|
|
-------------------------------------------------------------------------------------------------------
|
|
<span class="token number">0</span> boolea unsafe <span class="token boolean">false</span> Option to support sy This option enables to proxy functionality
|
|
n stem-level class of JVM classes. Due to serious security r
|
|
isk a JVM crash is possibly be introduced.
|
|
Do not activate it unless you are able to
|
|
manage.
|
|
<span class="token number">1</span> boolea dump <span class="token boolean">false</span> Option to dump the e This option enables the enhanced classes t
|
|
n nhanced classes o be dumped to external <span class="token function">file</span> <span class="token keyword">for</span> further d
|
|
e-compilation and analysis.
|
|
<span class="token number">1</span> boolea batch-re-tra <span class="token boolean">true</span> Option to support ba This options enables to reTransform classe
|
|
n nsform tch reTransform Clas s with batch mode.
|
|
s
|
|
<span class="token number">2</span> boolea json-format <span class="token boolean">false</span> Option to support JS This option enables to <span class="token function">format</span> object outpu
|
|
n ON <span class="token function">format</span> of object t with JSON when <span class="token parameter variable">-x</span> option selected.
|
|
output
|
|
<span class="token number">1</span> boolea disable-sub- <span class="token boolean">false</span> Option to control <span class="token keyword">in</span> This option disable to include sub class w
|
|
n class clude sub class when hen matching class.
|
|
class matching
|
|
<span class="token number">1</span> boolea support-defa <span class="token boolean">true</span> Option to control <span class="token keyword">in</span> This option disable to include default met
|
|
n ult-method clude default method hod <span class="token keyword">in</span> interface when matching class.
|
|
<span class="token keyword">in</span> interface when c
|
|
lass matching
|
|
<span class="token number">1</span> boolea save-result <span class="token boolean">false</span> Option to print <span class="token function">comm</span> This option enables to save each <span class="token builtin class-name">command</span><span class="token string">'s
|
|
n and'</span>s result to log result to log file, <span class="token function">which</span> path is <span class="token variable">\${user.
|
|
file home}</span>/logs/arthas-cache/result.log.
|
|
<span class="token number">2</span> String job-timeout 1d Option to job timeou This option setting job timeout,The unit c
|
|
t an be d, h, m, s <span class="token keyword">for</span> day, hour, minute, se
|
|
cond. 1d is one day <span class="token keyword">in</span> default
|
|
<span class="token number">1</span> boolea print-parent <span class="token boolean">true</span> Option to print all This option enables print files <span class="token keyword">in</span> parent
|
|
n <span class="token parameter variable">-fields</span> fileds <span class="token keyword">in</span> parent cla class, default value true.
|
|
ss
|
|
<span class="token number">1</span> boolea verbose <span class="token boolean">false</span> Option to print verb This option enables print verbose informat
|
|
n ose information ion, default value false.
|
|
<span class="token number">1</span> boolea strict <span class="token boolean">true</span> Option to strict mod By default, strict mode is true, not allow
|
|
n e ed to <span class="token builtin class-name">set</span> object properties. Want to <span class="token builtin class-name">set</span> o
|
|
bject properties, execute <span class="token variable"><span class="token variable">\`</span>options strict
|
|
<span class="token boolean">false</span><span class="token variable">\`</span></span>
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="get-special-option-value" tabindex="-1"><a class="header-anchor" href="#get-special-option-value" aria-hidden="true">#</a> Get special option value</h2><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>$ options json-format
|
|
LEVEL TYPE NAME VALUE SUMMARY DESCRIPTION
|
|
--------------------------------------------------------------------------------------------
|
|
2 bool json-format false Option to support This option enables to format object
|
|
ean JSON format of obj output with JSON when -x option selec
|
|
ect output ted.
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>By default, <code>json-format</code> is false. When set <code>json-format</code> to true, commands like <code>wathc</code>/<code>tt</code> will print result with <code>json</code> format.</p></div><h2 id="set-special-option-value" tabindex="-1"><a class="header-anchor" href="#set-special-option-value" aria-hidden="true">#</a> Set special option value</h2><p>For example, to enable saving command execution result, input the command below:</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>$ options save-result true
|
|
NAME BEFORE-VALUE AFTER-VALUE
|
|
----------------------------------------
|
|
save-result false true
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="set-unsafe-to-true-to-enhance-the-classes-under-the-java-package" tabindex="-1"><a class="header-anchor" href="#set-unsafe-to-true-to-enhance-the-classes-under-the-java-package" aria-hidden="true">#</a> Set <code>unsafe</code> to true to enhance the classes under the <code>java.*</code> package</h2><p>By default, <code>watch</code>/<code>trace</code>/<code>tt</code>/<code>trace</code>/<code>monitor</code> command do not support classes under <code>java.*</code> package. You can set <code>unsafe</code> to true to enhance the classes under the <code>java.*</code> package.</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ options unsafe <span class="token boolean">true</span>
|
|
NAME BEFORE-VALUE AFTER-VALUE
|
|
-----------------------------------
|
|
unsafe <span class="token boolean">false</span> <span class="token boolean">true</span>
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ <span class="token function">watch</span> java.lang.invoke.Invokers callSiteForm
|
|
Press Q or Ctrl+C to abort.
|
|
Affect<span class="token punctuation">(</span>class count: <span class="token number">1</span> , method count: <span class="token number">1</span><span class="token punctuation">)</span> cost <span class="token keyword">in</span> <span class="token number">61</span> ms, listenerId: <span class="token number">1</span>
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="turn-off-strict-mode-allow-setting-object-properties-in-ognl-expressions" tabindex="-1"><a class="header-anchor" href="#turn-off-strict-mode-allow-setting-object-properties-in-ognl-expressions" aria-hidden="true">#</a> Turn off strict mode, allow setting object properties in ognl expressions</h2><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>since 3.6.0</p></div><p>For new users, there may be misuses when writing ognl expressions.</p><p>For example, for <code>Student</code>, when judging the age is equal to 18, the conditional expression may be mistakenly written as <code>target.age=18</code>, which actually sets the <code>age</code> of the current object to 18. The correct spelling is <code>target.age==18</code>.</p><p>In order to prevent misuse like the above, Arthas enables <code>strict</code> mode by default, in <code>ognl</code> expressions, it is forbidden to update the property of the object or call the <code>setter</code> method.</p><p>Take <code>MathGame</code> as an example, the following error message will appear.</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>$ watch demo.MathGame primeFactors 'target' 'target.illegalArgumentCount=1'
|
|
Press Q or Ctrl+C to abort.
|
|
Affect(class count: 1 , method count: 1) cost in 206 ms, listenerId: 1
|
|
watch failed, condition is: target.illegalArgumentCount=1, express is: target, By default, strict mode is true, not allowed to set object properties. Want to set object properties, execute \`options strict false\`, visit /Users/admin/logs/arthas/arthas.log for more details.
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>If the user want to change the object properties in the <code>ognl</code> expression, you can execute <code>options strict false</code> to turn off the <code>strict</code> mode.</p><ul><li>For more information, please refer to: https://github.com/alibaba/arthas/issues/2128</li></ul>`,21);function L(B,C){const s=c("ExternalLinkIcon");return o(),l("div",null,[d,e("p",null,[e("a",u,[p,h,t(s)])]),m,e("table",null,[b,e("tbody",null,[v,f,g,k,_,e("tr",null,[w,x,e("td",null,[j,y,T,e("a",E,[O,t(s)])])]),A,V,I,N,S])]),M])}const U=a(r,[["render",L],["__file","options.html.vue"]]);export{U as default};
|