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/batch-support.html.6043e5f6.js

11 lines
4.0 KiB
JavaScript

import{_ as n,o as c,c as o,a as e,b as i,w as d,d as a,e as s,r}from"./app.5024572d.js";const l={},h=a(`<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. The process name can be specified using the \u201C\u2013select\u201D parameter.</p><h2 id="usage" tabindex="-1"><a class="header-anchor" href="#usage" aria-hidden="true">#</a> Usage</h2><h3 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</h3><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 <span class="token parameter variable">-n</span> <span class="token number">1</span>
session
thread
sc <span class="token parameter variable">-d</span> 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),p=a("<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),u=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"),_=a(`<h3 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</h3><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 <span class="token parameter variable">-f</span> /var/tmp/test.as <span class="token number">56328</span> <span class="token operator">&gt;</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 <span class="token parameter variable">-c</span> <span class="token string">&#39;sysprop; thread&#39;</span> <span class="token number">56328</span> <span class="token operator">&gt;</span> test.out
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 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</h3><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 t=r("RouterLink");return c(),o("div",null,[h,e("ul",null,[p,e("li",null,[u,m,b,v,f,i(t,{to:"/en/doc/async.html"},{default:d(()=>[g]),_:1})])]),_])}const B=n(l,[["render",k],["__file","batch-support.html.vue"]]);export{B as default};