mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-21 07:06:18 +00:00
update doc
This commit is contained in:
1 parent
30b2a190c6
commit
da5f4a397d
35 files changed
+417
-45
No files matched your search
+40
-6
@@ -126,7 +126,8 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="#enhancer">enhancer</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#others">Others</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#cases">Cases</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#get-classpath-of-java-application">Get classpath of Java application</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#make-watch-command-output-a-map-object">Make watch command output a map object</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -229,9 +230,9 @@ http api.</p>
|
||||
<h3>Request data format<a class="headerlink" href="#request-data-format" title="Permalink to this headline">¶</a></h3>
|
||||
<div class="highlight-json notranslate"><div class="highlight hljs"><pre class="json">{
|
||||
"action": "exec",
|
||||
"requestId": "req112"
|
||||
"sessionId": "94766d3c-8b39-42d3-8596-98aee3ccbefb"
|
||||
"consumerId": "955dbd1325334a84972b0f3ac19de4f7_2"
|
||||
"requestId": "req112",
|
||||
"sessionId": "94766d3c-8b39-42d3-8596-98aee3ccbefb",
|
||||
"consumerId": "955dbd1325334a84972b0f3ac19de4f7_2",
|
||||
"command": "version",
|
||||
"execTimeout": "10000"
|
||||
}</pre></div>
|
||||
@@ -754,9 +755,42 @@ receive this <code class="docutils literal notranslate"><span class="pre">enhanc
|
||||
prompt the user according to the result of <code class="docutils literal notranslate"><span class="pre">enhancer</span></code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="others">
|
||||
<h2>Others<a class="headerlink" href="#others" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="cases">
|
||||
<h2>Cases<a class="headerlink" href="#cases" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="get-classpath-of-java-application">
|
||||
<h3>Get classpath of Java application<a class="headerlink" href="#get-classpath-of-java-application" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Get system properties of the Java application through Http api and
|
||||
extract the value of <code class="docutils literal notranslate"><span class="pre">java.class.path</span></code>.</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">json_data=$(curl -Ss -XPOST http://localhost:8563/api -d '
|
||||
{
|
||||
"action":"exec",
|
||||
"command":"sysprop"
|
||||
}')</pre></div>
|
||||
</div>
|
||||
<ul class="simple">
|
||||
<li><p>Extract value with <code class="docutils literal notranslate"><span class="pre">sed</span></code>:</p></li>
|
||||
</ul>
|
||||
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">class_path=$(echo $json_data | tr -d '\n' | sed 's/.*"java.class.path":"\([^"]*\).*/\1/')
|
||||
echo "classpath: $class_path"</pre></div>
|
||||
</div>
|
||||
<ul class="simple">
|
||||
<li><p>Extract value with <code class="docutils literal notranslate"><span class="pre">json_pp/awk</span></code>:</p></li>
|
||||
</ul>
|
||||
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">class_path=$(echo $json_data | tr -d '\n' | json_pp | grep java.class.path | awk -F'"' '{ print $4 }')
|
||||
echo "classpath: $class_path"</pre></div>
|
||||
</div>
|
||||
<p>Output:</p>
|
||||
<div class="highlight-default notranslate"><pre class="literal-block">classpath: demo-arthas-spring-boot.jar</pre>
|
||||
</div>
|
||||
<p>NOTE:</p>
|
||||
<ul class="simple">
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">echo</span> <span class="pre">$json_data</span> <span class="pre">|</span> <span class="pre">tr</span> <span class="pre">-d</span> <span class="pre">'\n'</span></code> : Delete line breaks (the value of
|
||||
<code class="docutils literal notranslate"><span class="pre">line.separator</span></code>) to avoid affecting the processing of <code class="docutils literal notranslate"><span class="pre">sed</span></code>/<code class="docutils literal notranslate"><span class="pre">json_pp</span></code>
|
||||
commands.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">awk</span> <span class="pre">-F'"'</span> <span class="pre">'{</span> <span class="pre">print</span> <span class="pre">$4</span> <span class="pre">}'</span></code> : Use double quote as delimiter</p></li>
|
||||
</ul>
|
||||
<p><a id="change_watch_value_to_map"></a></p>
|
||||
</div>
|
||||
<div class="section" id="make-watch-command-output-a-map-object">
|
||||
<h3>Make watch command output a map object<a class="headerlink" href="#make-watch-command-output-a-map-object" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The result value of <code class="docutils literal notranslate"><span class="pre">watch</span></code> is generated by calculating the
|
||||
|
||||
Reference in new issue
Block a user