Update cheatsheets

This commit is contained in:
ivuorinen
2025-01-24 00:17:02 +00:00
parent 790978a4cd
commit 068c24ac65
8 changed files with 79 additions and 5 deletions

26
tldr/arthas Normal file
View File

@@ -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: <https://arthas.aliyun.com/en/>.
- 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`

26
tldr/arthas-trace Normal file
View File

@@ -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: <https://arthas.aliyun.com/en/doc/trace.html>.
- 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`

22
tldr/arthas-watch Normal file
View File

@@ -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: <https://arthas.aliyun.com/en/doc/watch.html>.
- 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`

View File

@@ -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: <https://www.pulumi.com/docs/cli>.
> More information: <https://www.pulumi.com/docs/iac/cli/>.
- Create a new project using a template:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# pulumi destroy
> Destroy all existing resources in a stack.
> More information: <https://www.pulumi.com/docs/cli/commands/pulumi_destroy/>.
> More information: <https://www.pulumi.com/docs/iac/cli/commands/pulumi_destroy/>.
- Destroy all resources in the current stack:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# pulumi login
> Log in to the Pulumi cloud.
> More information: <https://www.pulumi.com/docs/cli/commands/pulumi_login/>.
> More information: <https://www.pulumi.com/docs/iac/cli/commands/pulumi_login/>.
- Log in to the managed Pulumi Cloud backend, defaults to `app.pulumi.cloud`:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# pulumi logout
> Log out of the Pulumi cloud.
> More information: <https://www.pulumi.com/docs/cli/commands/pulumi_logout/>.
> More information: <https://www.pulumi.com/docs/iac/cli/commands/pulumi_logout/>.
- Log out of a specific cloud backend:

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# pulumi up
> Create or update the resources in a stack.
> More information: <https://www.pulumi.com/docs/cli/commands/pulumi_up/>.
> More information: <https://www.pulumi.com/docs/iac/cli/commands/pulumi_up/>.
- Preview and deploy changes to a program and/or infrastructure: