From 068c24ac650cbd3dffa461941cc7eb75abc4e6d9 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Fri, 24 Jan 2025 00:17:02 +0000 Subject: [PATCH] Update cheatsheets --- tldr/arthas | 26 ++++++++++++++++++++++++++ tldr/arthas-trace | 26 ++++++++++++++++++++++++++ tldr/arthas-watch | 22 ++++++++++++++++++++++ tldr/pulumi | 2 +- tldr/pulumi-destroy | 2 +- tldr/pulumi-login | 2 +- tldr/pulumi-logout | 2 +- tldr/pulumi-up | 2 +- 8 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 tldr/arthas create mode 100644 tldr/arthas-trace create mode 100644 tldr/arthas-watch diff --git a/tldr/arthas b/tldr/arthas new file mode 100644 index 00000000..58d45a04 --- /dev/null +++ b/tldr/arthas @@ -0,0 +1,26 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# arthas + +> Java diagnostic tool. +> See also: `arthas-watch`, `arthas-trace`. +> More information: . + +- Start Arthas: + +`java -jar {{path/to/arthas-boot.jar}}` + +- Reconnect Arthas (default port used by Arthas is 3658): + +`telnet localhost {{port_number}}` + +- Exit the current Arthas client without affecting other clients. equals `exit`、`logout`、`q` command: + +`exit|quit|logout|q` + +- Terminate the Arthas server, all the Arthas clients connecting to this server will be disconnected: + +`stop` diff --git a/tldr/arthas-trace b/tldr/arthas-trace new file mode 100644 index 00000000..046ac9a4 --- /dev/null +++ b/tldr/arthas-trace @@ -0,0 +1,26 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# arthas-trace + +> Trace method invoke chain, and output the time cost for each node in the path. +> See also: `arthas`, `arthas-watch`. +> More information: . + +- Trace method invoke chain: + +`trace {{class-pattern}} {{method-pattern}}` + +- Trace method invoke chains and only display invoke information longer than 10 ms: + +`trace {{class-pattern}} {{method-pattern}} '#cost > {{10}}'` + +- Trace the invoke chain of multiple classes or multiple methods: + +`trace -E {{class-pattern1|class-patter2}} {{method-pattern1|method-pattern2|method-pattern3}}` + +- Track method invoke chains, only display invoke information that exceeds 10 ms, and exit after 5 times: + +`trace {{class-pattern}} {{method-pattern}} '#cost > {{10}}' -n 5` diff --git a/tldr/arthas-watch b/tldr/arthas-watch new file mode 100644 index 00000000..3c1776a6 --- /dev/null +++ b/tldr/arthas-watch @@ -0,0 +1,22 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# arthas-watch + +> Method invoke data observation. +> See also: `arthas`, `arthas-trace`. +> More information: . + +- Observe the first parameter and return value of method, and expand the nested attributes of the object to 4 levels: + +`watch {{class-pattern}} {{method-pattern}} {{'{ params[0],returnObj }'}} -x 4` + +- When the value of the first parameter of the method is 5, the second parameter and return value are output, and the object is expanded 4 layers: + +`watch {{class-pattern}} {{method-pattern}} {{'{ params[1],returnObj }'}} {{'"5".equals(params[0])'}} -x 4` + +- When the method returns or an exception occurs, observe the count property of the second parameter: + +`watch {{class-pattern}} {{method-pattern}} {{'{ params[1].count }'}} -e -s` diff --git a/tldr/pulumi b/tldr/pulumi index 3e2ead2c..5006f504 100644 --- a/tldr/pulumi +++ b/tldr/pulumi @@ -7,7 +7,7 @@ source: https://github.com/tldr-pages/tldr.git > Define infrastructure on any cloud using familiar programming languages. > Some subcommands such as `up` have their own usage documentation. -> More information: . +> More information: . - Create a new project using a template: diff --git a/tldr/pulumi-destroy b/tldr/pulumi-destroy index 2e012536..a65b7d44 100644 --- a/tldr/pulumi-destroy +++ b/tldr/pulumi-destroy @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # pulumi destroy > Destroy all existing resources in a stack. -> More information: . +> More information: . - Destroy all resources in the current stack: diff --git a/tldr/pulumi-login b/tldr/pulumi-login index c2fe2c33..51bf4f50 100644 --- a/tldr/pulumi-login +++ b/tldr/pulumi-login @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # pulumi login > Log in to the Pulumi cloud. -> More information: . +> More information: . - Log in to the managed Pulumi Cloud backend, defaults to `app.pulumi.cloud`: diff --git a/tldr/pulumi-logout b/tldr/pulumi-logout index f5b83d68..f5300b06 100644 --- a/tldr/pulumi-logout +++ b/tldr/pulumi-logout @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # pulumi logout > Log out of the Pulumi cloud. -> More information: . +> More information: . - Log out of a specific cloud backend: diff --git a/tldr/pulumi-up b/tldr/pulumi-up index 0366d09f..a43a4d37 100644 --- a/tldr/pulumi-up +++ b/tldr/pulumi-up @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # pulumi up > Create or update the resources in a stack. -> More information: . +> More information: . - Preview and deploy changes to a program and/or infrastructure: