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.
arthas/assets/monitor.html.b861dd2b.js

82 lines
20 KiB
JavaScript

import{_ as e,o as t,c as l,a as s,b as i,e as n,d as r,r as o}from"./app.5024572d.js";const c={},p=s("h1",{id:"monitor",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#monitor","aria-hidden":"true"},"#"),n(" monitor")],-1),m={href:"https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en&id=command-monitor",target:"_blank",rel:"noopener noreferrer"},d=s("code",null,"monitor",-1),u=n(" online tutorial"),b=r(`<div class="custom-container tip"><p class="custom-container-title">TIP</p><p>Monitor method invocation.</p></div><p>Monitor invocation for the method matched with <code>class-pattern</code> and <code>method-pattern</code> and filter by <code>condition-expression</code>.</p><p><code>monitor</code> is not a command returning immediately.</p><p>A command returning immediately is a command immediately returns with the result after the command is input, while a non-immediate returning command will keep outputting the information from the target JVM process until user presses <code>Ctrl+C</code>.</p><p>On Arthas&#39;s server side, the command is running as a background job, but the weaved code will not take further effect once the job is terminated, therefore, it will not impact the performance after the job quits. Furthermore, Arthas is designed to have no side effect to the business logic.</p><h2 id="items-to-monitor" tabindex="-1"><a class="header-anchor" href="#items-to-monitor" aria-hidden="true">#</a> Items to monitor</h2><table><thead><tr><th style="text-align:right;">Item</th><th style="text-align:left;">Specification</th></tr></thead><tbody><tr><td style="text-align:right;">timestamp</td><td style="text-align:left;">timestamp</td></tr><tr><td style="text-align:right;">class</td><td style="text-align:left;">Java class</td></tr><tr><td style="text-align:right;">method</td><td style="text-align:left;">method (constructor and regular methods)</td></tr><tr><td style="text-align:right;">total</td><td style="text-align:left;">calling times</td></tr><tr><td style="text-align:right;">success</td><td style="text-align:left;">success count</td></tr><tr><td style="text-align:right;">fail</td><td style="text-align:left;">failure count</td></tr><tr><td style="text-align:right;">rt</td><td style="text-align:left;">average RT</td></tr><tr><td style="text-align:right;">fail-rate</td><td style="text-align:left;">failure ratio</td></tr></tbody></table><h2 id="parameters" tabindex="-1"><a class="header-anchor" href="#parameters" aria-hidden="true">#</a> Parameters</h2><p>Parameter <code>[c:]</code> stands for cycles of statistics. Its value is an integer value in seconds.</p><table><thead><tr><th style="text-align:right;">Name</th><th style="text-align:left;">Specification</th></tr></thead><tbody><tr><td style="text-align:right;"><em>class-pattern</em></td><td style="text-align:left;">pattern for the class name</td></tr><tr><td style="text-align:right;"><em>method-pattern</em></td><td style="text-align:left;">pattern for the method name</td></tr><tr><td style="text-align:right;"><em>condition-expression</em></td><td style="text-align:left;">condition expression for filtering method calls</td></tr><tr><td style="text-align:right;"><code>[E]</code></td><td style="text-align:left;">turn on regex matching while the default is wildcard matching</td></tr><tr><td style="text-align:right;"><code>[c:]</code></td><td style="text-align:left;">cycle of statistics, the default value: <code>120</code>s</td></tr><tr><td style="text-align:right;"><code>[b]</code></td><td style="text-align:left;">evaluate the condition-expression before method invoke</td></tr><tr><td style="text-align:right;"><code>[m &lt;arg&gt;]</code></td><td style="text-align:left;">Specify the max number of matched Classes, the default value is 50. Long format is <code>[maxMatch &lt;arg&gt;]</code>.</td></tr></tbody></table><h2 id="usage" tabindex="-1"><a class="header-anchor" href="#usage" aria-hidden="true">#</a> Usage</h2><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ monitor <span class="token parameter variable">-c</span>
3 years ago
Press Ctrl+C to abort.
Affect<span class="token punctuation">(</span>class-cnt:1 , method-cnt:1<span class="token punctuation">)</span> cost <span class="token keyword">in</span> <span class="token number">94</span> ms.
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
-----------------------------------------------------------------------------------------------
<span class="token number">2018</span>-12-03 <span class="token number">19</span>:06:38 demo.MathGame primeFactors <span class="token number">5</span> <span class="token number">1</span> <span class="token number">4</span> <span class="token number">1.15</span> <span class="token number">80.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
-----------------------------------------------------------------------------------------------
<span class="token number">2018</span>-12-03 <span class="token number">19</span>:06:43 demo.MathGame primeFactors <span class="token number">5</span> <span class="token number">3</span> <span class="token number">2</span> <span class="token number">42.29</span> <span class="token number">40.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
-----------------------------------------------------------------------------------------------
<span class="token number">2018</span>-12-03 <span class="token number">19</span>:06:48 demo.MathGame primeFactors <span class="token number">5</span> <span class="token number">3</span> <span class="token number">2</span> <span class="token number">67.92</span> <span class="token number">40.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
-----------------------------------------------------------------------------------------------
<span class="token number">2018</span>-12-03 <span class="token number">19</span>:06:53 demo.MathGame primeFactors <span class="token number">5</span> <span class="token number">2</span> <span class="token number">3</span> <span class="token number">0.25</span> <span class="token number">60.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
-----------------------------------------------------------------------------------------------
<span class="token number">2018</span>-12-03 <span class="token number">19</span>:06:58 demo.MathGame primeFactors <span class="token number">1</span> <span class="token number">1</span> <span class="token number">0</span> <span class="token number">0.45</span> <span class="token number">0.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
-----------------------------------------------------------------------------------------------
<span class="token number">2018</span>-12-03 <span class="token number">19</span>:07:03 demo.MathGame primeFactors <span class="token number">2</span> <span class="token number">2</span> <span class="token number">0</span> <span class="token number">3182.72</span> <span class="token number">0.00</span>%
2 years ago
</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></div><h3 id="specify-the-max-number-of-matched-classes" tabindex="-1"><a class="header-anchor" href="#specify-the-max-number-of-matched-classes" aria-hidden="true">#</a> Specify the max number of matched Classes</h3><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ monitor <span class="token parameter variable">-c</span> <span class="token number">1</span> <span class="token parameter variable">-m</span> <span class="token number">1</span> demo.MathGame primeFactors
Press Q or Ctrl+C to abort.
Affect<span class="token punctuation">(</span>class count:1 , method count:1<span class="token punctuation">)</span> cost <span class="token keyword">in</span> <span class="token number">384</span> ms, listenerId: <span class="token number">6</span>.
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
-----------------------------------------------------------------------------------------------
<span class="token number">2022</span>-12-25 <span class="token number">21</span>:12:58 demo.MathGame primeFactors <span class="token number">1</span> <span class="token number">1</span> <span class="token number">0</span> <span class="token number">0.18</span> <span class="token number">0.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
-----------------------------------------------------------------------------------------------
<span class="token number">2022</span>-12-25 <span class="token number">21</span>:12:59 demo.MathGame primeFactors <span class="token number">0</span> <span class="token number">0</span> <span class="token number">0</span> <span class="token number">0.00</span> <span class="token number">0.00</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></div><h3 id="evaluate-condition-express-to-filter-method-after-method-call" tabindex="-1"><a class="header-anchor" href="#evaluate-condition-express-to-filter-method-after-method-call" aria-hidden="true">#</a> Evaluate condition-express to filter method (after method call)</h3><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>monitor <span class="token parameter variable">-c</span> <span class="token number">5</span> demo.MathGame primeFactors <span class="token string">&quot;params[0] &lt;= 2&quot;</span>
3 years ago
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">19</span> ms, listenerId: <span class="token number">5</span>
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
-----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:42:36 demo.MathGame primeFactors <span class="token number">5</span> <span class="token number">3</span> <span class="token number">2</span> <span class="token number">0.09</span> <span class="token number">40.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:42:41 demo.MathGame primeFactors <span class="token number">5</span> <span class="token number">2</span> <span class="token number">3</span> <span class="token number">0.11</span> <span class="token number">60.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:42:46 demo.MathGame primeFactors <span class="token number">5</span> <span class="token number">1</span> <span class="token number">4</span> <span class="token number">0.06</span> <span class="token number">80.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:42:51 demo.MathGame primeFactors <span class="token number">5</span> <span class="token number">1</span> <span class="token number">4</span> <span class="token number">0.12</span> <span class="token number">80.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:42:56 demo.MathGame primeFactors <span class="token number">5</span> <span class="token number">3</span> <span class="token number">2</span> <span class="token number">0.15</span> <span class="token number">40.00</span>%
2 years ago
</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></div><h3 id="evaluate-condition-express-to-filter-method-before-method-call" tabindex="-1"><a class="header-anchor" href="#evaluate-condition-express-to-filter-method-before-method-call" aria-hidden="true">#</a> Evaluate condition-express to filter method (before method call)</h3><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>monitor <span class="token parameter variable">-b</span> <span class="token parameter variable">-c</span> <span class="token number">5</span> com.test.testes.MathGame primeFactors <span class="token string">&quot;params[0] &lt;= 2&quot;</span>
3 years ago
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">21</span> ms, listenerId: <span class="token number">4</span>
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:41:57 demo.MathGame primeFactors <span class="token number">1</span> <span class="token number">0</span> <span class="token number">1</span> <span class="token number">0.10</span> <span class="token number">100.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:42:02 demo.MathGame primeFactors <span class="token number">3</span> <span class="token number">0</span> <span class="token number">3</span> <span class="token number">0.06</span> <span class="token number">100.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:42:07 demo.MathGame primeFactors <span class="token number">2</span> <span class="token number">0</span> <span class="token number">2</span> <span class="token number">0.06</span> <span class="token number">100.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:42:12 demo.MathGame primeFactors <span class="token number">1</span> <span class="token number">0</span> <span class="token number">1</span> <span class="token number">0.05</span> <span class="token number">100.00</span>%
timestamp class method total success fail avg-rt<span class="token punctuation">(</span>ms<span class="token punctuation">)</span> fail-rate
----------------------------------------------------------------------------------------------
<span class="token number">2020</span>-09-02 09:42:17 demo.MathGame primeFactors <span class="token number">2</span> <span class="token number">0</span> <span class="token number">2</span> <span class="token number">0.10</span> <span class="token number">100.00</span>%
2 years ago
</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></div>`,18);function v(h,k){const a=o("ExternalLinkIcon");return t(),l("div",null,[p,s("p",null,[s("a",m,[d,u,i(a)])]),b])}const g=e(c,[["render",v],["__file","monitor.html.vue"]]);export{g as default};