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.
11 lines
3.7 KiB
JavaScript
11 lines
3.7 KiB
JavaScript
import{_ as n,o as c,c as o,a as e,b as i,w as d,d as t,e as s,r}from"./app.391b0e4e.js";const l={},h=t(`<h1 id="batch-processing" tabindex="-1"><a class="header-anchor" href="#batch-processing" aria-hidden="true">#</a> Batch Processing</h1><p>With the help of Batch Processing, you can run multiple commands in batch and get the final result at the end.</p><h3 id="usage" tabindex="-1"><a class="header-anchor" href="#usage" aria-hidden="true">#</a> Usage</h3><h4 id="step-1-create-the-script" tabindex="-1"><a class="header-anchor" href="#step-1-create-the-script" aria-hidden="true">#</a> Step 1: Create the script</h4><p>Create a <code>test.as</code> script suffixed with <code>as</code>. Here <code>as</code> is suggested for the suffix of the filename, but in fact any suffix is acceptable.</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>\u279C arthas git:<span class="token punctuation">(</span>develop<span class="token punctuation">)</span> <span class="token function">cat</span> /var/tmp/test.as
|
|
<span class="token builtin class-name">help</span>
|
|
dashboard -n <span class="token number">1</span>
|
|
session
|
|
thread
|
|
sc -d org.apache.commons.lang.StringUtils
|
|
</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><p>Note:</p>`,7),u=t("<li>Each command takes one line.</li><li>Batch mode execution times (via <code>-n</code>) must be explicitly specified for <code>dashboard</code>, otherwise batch script cannot terminate.</li><li>Commands such as <code>watch</code>/<code>tt</code>/<code>trace</code>/<code>monitor</code>/<code>stack</code> should include <code>-n</code> option to ensure the script can be able to quit.</li>",3),p=s("Also consider to use "),m=e("code",null,"async",-1),b=s(" (for example: "),v=e("code",null,"watch c.t.X test returnObj > &",-1),f=s(") to put commands run at background and get the output from the log file, see more from "),g=s("asynchronous job"),_=t(`<h4 id="step-2-run-the-script" tabindex="-1"><a class="header-anchor" href="#step-2-run-the-script" aria-hidden="true">#</a> Step 2: Run the script</h4><p>Use <code>-f</code> to specify the script file. By default the result will be output to the standard output, but you can redirect the output to the file like this:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>./as.sh -f /var/tmp/test.as <span class="token number">56328</span> <span class="token operator">></span> test.out
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>Use <code>-c</code> also can specify the commands, like this:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>./as.sh -c <span class="token string">'sysprop; thread'</span> <span class="token number">56328</span> <span class="token operator">></span> test.out
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h4 id="step-3-check-the-output" tabindex="-1"><a class="header-anchor" href="#step-3-check-the-output" aria-hidden="true">#</a> Step 3: Check the output</h4><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token function">cat</span> test.out
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div>`,7);function k(x,y){const a=r("RouterLink");return c(),o("div",null,[h,e("ul",null,[u,e("li",null,[p,m,b,v,f,i(a,{to:"/en/doc/async.html"},{default:d(()=>[g]),_:1})])]),_])}var B=n(l,[["render",k],["__file","batch-support.html.vue"]]);export{B as default};
|