<liclass="toctree-l1"><aclass="reference external"href="https://github.com/alibaba/arthas/issues?q=label%3Aquestion-answered">Questions and answers</a></li>
<liclass="toctree-l1"><aclass="reference external"href="https://github.com/alibaba/arthas">Fork me at GitHub</a></li>
<spanid="step-1-create-the-script"></span><h3>Step 1: Create the script<aclass="headerlink"href="#step-1-create-the-script"title="Permalink to this headline">¶</a></h3>
<p>Create a <codeclass="docutils literal notranslate"><spanclass="pre">test.as</span></code> script suffixed with <codeclass="docutils literal notranslate"><spanclass="pre">as</span></code>. Here <codeclass="docutils literal notranslate"><spanclass="pre">as</span></code> is suggested for the suffix of the filename, but in fact any suffix is acceptable.</p>
<li>Batch mode (via <codeclass="docutils literal notranslate"><spanclass="pre">-b</span></code>) and execution times (via <codeclass="docutils literal notranslate"><spanclass="pre">-n</span></code>) must be explicitly specified for <codeclass="docutils literal notranslate"><spanclass="pre">dashboard</span></code>, otherwise batch script cannot terminate.</li>
<li>Commands such as <codeclass="docutils literal notranslate"><spanclass="pre">watch</span></code>/<codeclass="docutils literal notranslate"><spanclass="pre">tt</span></code>/<codeclass="docutils literal notranslate"><spanclass="pre">trace</span></code>/<codeclass="docutils literal notranslate"><spanclass="pre">monitor</span></code>/<codeclass="docutils literal notranslate"><spanclass="pre">stack</span></code> should include <codeclass="docutils literal notranslate"><spanclass="pre">-n</span></code> option to ensure the script can be able to quit.</li>
<li>Also consider to use <codeclass="docutils literal notranslate"><spanclass="pre">async</span></code> (for example: <codeclass="docutils literal notranslate"><spanclass="pre">watch</span><spanclass="pre">c.t.X</span><spanclass="pre">test</span><spanclass="pre">returnObj</span><spanclass="pre">></span><spanclass="pre">&</span></code>) to put commands run at background and get the output from the log file, see more from <aclass="reference internal"href="async.html"><spanclass="doc">asynchronous job</span></a></li>
<spanid="step-2-run-the-script"></span><h3>Step 2: Run the script<aclass="headerlink"href="#step-2-run-the-script"title="Permalink to this headline">¶</a></h3>
<p>Use <codeclass="docutils literal notranslate"><spanclass="pre">-b</span></code> to turn on batch mode, and use <codeclass="docutils literal notranslate"><spanclass="pre">-f</span></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>
<spanid="step-3-check-the-outputs"></span><h3>Step 3: Check the outputs<aclass="headerlink"href="#step-3-check-the-outputs"title="Permalink to this headline">¶</a></h3>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.