@appland/appmap 3.146.0 → 3.147.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/built/docs/CLA Instructions.pdf +0 -0
- package/built/docs/Code of Conduct for Contributors.pdf +0 -0
- package/built/docs/analysis/rules-reference.html +27 -0
- package/built/docs/appmap-docs.md +27 -0
- package/built/docs/community.md +28 -0
- package/built/docs/guides/exporting-appmap-diagrams.md +50 -0
- package/built/docs/guides/handling-large-appmap-diagrams.md +138 -0
- package/built/docs/guides/index.md +21 -0
- package/built/docs/guides/navigating-code-objects.md +67 -0
- package/built/docs/guides/openapi.md +105 -0
- package/built/docs/guides/reading-sql-in-appmap-diagrams.md +69 -0
- package/built/docs/guides/refine-appmap-data.md +186 -0
- package/built/docs/guides/reverse-engineering.md +377 -0
- package/built/docs/guides/runtime-code-review.md +111 -0
- package/built/docs/guides/using-appmap-analysis.md +206 -0
- package/built/docs/guides/using-appmap-diagrams.md +331 -0
- package/built/docs/integrations/atlassian-compass.md +25 -0
- package/built/docs/integrations/atlassian-confluence.md +51 -0
- package/built/docs/integrations/circle-ci.md +424 -0
- package/built/docs/integrations/docker.md +109 -0
- package/built/docs/integrations/github-actions.md +524 -0
- package/built/docs/integrations/index.md +20 -0
- package/built/docs/integrations/plantuml.md +66 -0
- package/built/docs/integrations/postman.md +30 -0
- package/built/docs/integrations/readme.md +39 -0
- package/built/docs/integrations/smartbear-swaggerhub.md +119 -0
- package/built/docs/reference/analysis-labels.md +49 -0
- package/built/docs/reference/analysis-rules.md +61 -0
- package/built/docs/reference/appmap-client-cli.md +628 -0
- package/built/docs/reference/appmap-gradle-plugin.md +141 -0
- package/built/docs/reference/appmap-java.md +311 -0
- package/built/docs/reference/appmap-maven-plugin.md +164 -0
- package/built/docs/reference/appmap-node.md +185 -0
- package/built/docs/reference/appmap-python.md +520 -0
- package/built/docs/reference/appmap-ruby.md +514 -0
- package/built/docs/reference/github-action.md +171 -0
- package/built/docs/reference/index.md +25 -0
- package/built/docs/reference/jetbrains.md +136 -0
- package/built/docs/reference/license-key-install.md +74 -0
- package/built/docs/reference/navie.md +261 -0
- package/built/docs/reference/remote-recording-api.md +97 -0
- package/built/docs/reference/uninstalling-appmap.md +119 -0
- package/built/docs/reference/vscode.md +122 -0
- package/built/docs/setup-appmap-in-ci/example-projects.md +21 -0
- package/built/docs/setup-appmap-in-ci/how-it-works.md +43 -0
- package/built/docs/setup-appmap-in-ci/in-circleci.md +423 -0
- package/built/docs/setup-appmap-in-ci/in-github-actions.md +177 -0
- package/built/docs/setup-appmap-in-ci/index.md +22 -0
- package/built/docs/setup-appmap-in-ci/matrix-builds.md +225 -0
- package/built/docs/setup-appmap-in-ci/troubleshooting.md +71 -0
- package/built/docs/setup-appmap-in-your-code-editor/add-appmap-to-your-code-editor.md +93 -0
- package/built/docs/setup-appmap-in-your-code-editor/appmap-analysis.md +77 -0
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmap-data-from-tests.md +93 -0
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmap-data-with-remote-recording.md +112 -0
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmap-data-with-request-recording.md +77 -0
- package/built/docs/setup-appmap-in-your-code-editor/how-appmap-works.md +166 -0
- package/built/docs/setup-appmap-in-your-code-editor/index.md +25 -0
- package/built/docs/setup-appmap-in-your-code-editor/navigating-appmap-diagrams.md +59 -0
- package/built/docs/setup-appmap-in-your-code-editor/navigating-code-objects.md +67 -0
- package/built/docs/unused_for_now_index.html +11 -0
- package/package.json +2 -2
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Reference
|
|
4
|
+
description: "Explore the AppMap CLI reference guide for analyzing runtime code behavior."
|
|
5
|
+
toc: true
|
|
6
|
+
reference: true
|
|
7
|
+
step: 10
|
|
8
|
+
name: Command line interface (CLI)
|
|
9
|
+
redirect_from: [docs/reference/appmap-swagger-ruby]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Command line interface (CLI)
|
|
13
|
+
|
|
14
|
+
- [Command line interface (CLI)](#command-line-interface-cli)
|
|
15
|
+
- [Overview](#overview)
|
|
16
|
+
- [Prerequisites](#prerequisites)
|
|
17
|
+
- [Install AppMap CLI Precompiled Binary](#install-appmap-cli-precompiled-binary)
|
|
18
|
+
- [Usage](#usage)
|
|
19
|
+
- [`install`](#install)
|
|
20
|
+
- [`inspect`](#inspect)
|
|
21
|
+
- [`sequence-diagram`](#sequence-diagram)
|
|
22
|
+
- [`sequence-diagram-diff`](#sequence-diagram-diff)
|
|
23
|
+
- [`openapi`](#openapi)
|
|
24
|
+
- [`stats`](#stats)
|
|
25
|
+
- [`prune`](#prune)
|
|
26
|
+
- [`archive`](#archive)
|
|
27
|
+
- [`restore`](#restore)
|
|
28
|
+
- [`compare`](#compare)
|
|
29
|
+
- [`compare-report`](#compare-report)
|
|
30
|
+
- [GitHub repository](#github-repository)
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
The AppMap CLI provides utility commands to install AppMap client libraries and work with AppMap Data.
|
|
35
|
+
|
|
36
|
+
## Prerequisites
|
|
37
|
+
|
|
38
|
+
### Install AppMap CLI Precompiled Binary
|
|
39
|
+
|
|
40
|
+
AppMap publishes binaries of the command-line installer for various operating systems, you can find the most recent version of the [AppMap command-line installer on GitHub](https://github.com/getappmap/appmap-js/releases?q=%40appland%2Fappmap*&expanded=true). Expand the "Assets" section to find binaries for Windows, Mac, and Linux.
|
|
41
|
+
|
|
42
|
+
Save this file locally and rename it to `appmap` (or `appmap.exe` for Windows). If you intend to access it from the command-line, ensure that you place the binary somewhere on your `PATH`.
|
|
43
|
+
|
|
44
|
+
The AppMap binary is all that is necessary to run the AppMap CLI (or `appmap.exe` for Windows).
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
Run the precompiled binary on the command line.
|
|
49
|
+
|
|
50
|
+
```console
|
|
51
|
+
$ appmap --help
|
|
52
|
+
```
|
|
53
|
+
{: .example-code}
|
|
54
|
+
|
|
55
|
+
## `install`
|
|
56
|
+
|
|
57
|
+
Open a terminal window in the top level folder of your project and run this command:
|
|
58
|
+
|
|
59
|
+
```console
|
|
60
|
+
$ appmap install
|
|
61
|
+
```
|
|
62
|
+
{: .example-code}
|
|
63
|
+
|
|
64
|
+
You will be guided through a series of steps for installing and configuring AppMap. Additionally, you'll have an option to auto-commit the library and configuration file to your repo, so that the rest of your team can use AppMap without having to repeat the setup process.
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Installing AppMap agent for ....
|
|
68
|
+
? AppMap is about to be installed. Confirm the details below.
|
|
69
|
+
Project type: Bundler
|
|
70
|
+
Project directory: /Users/username/repos/sample_rails_app
|
|
71
|
+
Git remote: origin git@github.com:land-of-apps/sample_rails_app.git (fetch)
|
|
72
|
+
Ruby version: 3.1.2p20
|
|
73
|
+
Gem home: /Users/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0
|
|
74
|
+
|
|
75
|
+
? AppMap is about to be installed. Confirm the details below.
|
|
76
|
+
? Commit these files to your repo so that everyone on your team can use AppMap
|
|
77
|
+
without them having to repeat the setup process. Bring runtime code analysis
|
|
78
|
+
to your whole team!
|
|
79
|
+
Gemfile
|
|
80
|
+
Gemfile.lock
|
|
81
|
+
appmap.yml
|
|
82
|
+
|
|
83
|
+
Commit? Yes
|
|
84
|
+
✔ Validating the AppMap agent...
|
|
85
|
+
|
|
86
|
+
╭─────────────────────────────────────────────────────────────────────╮
|
|
87
|
+
│ │
|
|
88
|
+
│ Success! AppMap has finished installing. │
|
|
89
|
+
│ │
|
|
90
|
+
│ NEXT STEP: Record AppMap Data │
|
|
91
|
+
│ │
|
|
92
|
+
│ You can consult the AppMap documentation, or continue with the │
|
|
93
|
+
│ instructions provided in the AppMap code editor extension. │
|
|
94
|
+
│ │
|
|
95
|
+
╰─────────────────────────────────────────────────────────────────────╯
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The installer changes your project's build process (yarn.lock for
|
|
99
|
+
JavaScript, Gemfile for Ruby, etc) to run AppMap when the tests run
|
|
100
|
+
and when developing locally. It will not be added to your production system.
|
|
101
|
+
|
|
102
|
+
## `inspect`
|
|
103
|
+
|
|
104
|
+
Search AppMap Data for references to a code object (package, function, class, query, route, etc) and print available event info.
|
|
105
|
+
|
|
106
|
+
```console
|
|
107
|
+
$ appmap inspect --help
|
|
108
|
+
```
|
|
109
|
+
{: .example-code}
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
appmap inspect <code-object>
|
|
113
|
+
|
|
114
|
+
Positionals:
|
|
115
|
+
|
|
116
|
+
code-object identifies the code-object to inspect [required]
|
|
117
|
+
|
|
118
|
+
Options:
|
|
119
|
+
--version Show version number [boolean]
|
|
120
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
121
|
+
--help Show help [boolean]
|
|
122
|
+
--appmap-dir directory to recursively inspect for AppMap Data
|
|
123
|
+
[default: "tmp/appmap"]
|
|
124
|
+
-i, --interactive interact with the output via CLI [boolean]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
You can use this command to search and display events and associated data from across all the AppMap Data in a directory (recursively explored).
|
|
128
|
+
|
|
129
|
+
The `code-object` argument is a required argument, composed of a type and identifier. The inspect command will find all events that match this code object across the AppMap Data. Whether an event matches the `code-object` argument is defined as follows:
|
|
130
|
+
|
|
131
|
+
| code-object type | match criteria |
|
|
132
|
+
| -----------------|----------------|
|
|
133
|
+
| function | The event is a call to the specified function |
|
|
134
|
+
| class | The event is a call to any function on the specified class |
|
|
135
|
+
| package |The event is a call to any function on any class in the specified package |
|
|
136
|
+
| database | The event is a SQL query |
|
|
137
|
+
| table | The event is a SQL query which includes the specified table |
|
|
138
|
+
| query | The event is a SQL query which, when normalized, matches the specified query |
|
|
139
|
+
| route | The event is an HTTP server request which matches the specified route method and normalized path. |
|
|
140
|
+
|
|
141
|
+
Examples of supported search syntax:
|
|
142
|
+
|
|
143
|
+
* `function:my/package/My::Class#instance_method`
|
|
144
|
+
* `function:my/package/My::Class.static_method`
|
|
145
|
+
* `class:my/package/My::Class`
|
|
146
|
+
* `package:my/package`
|
|
147
|
+
* `table:table_name`
|
|
148
|
+
* `database:`
|
|
149
|
+
* `route:REQUEST_METHOD /route/:id` (HTTP request method followed by normalized path)
|
|
150
|
+
* `query:SELECT * FROM tables WHERE some_column = ?` (normalized SQL)
|
|
151
|
+
|
|
152
|
+
### Interactive mode
|
|
153
|
+
|
|
154
|
+
With the `--interactive` option, the results are presented in table form, and you can refine and drill into the data using the command line.
|
|
155
|
+
|
|
156
|
+
```console
|
|
157
|
+
$ appmap inspect --interactive
|
|
158
|
+
```
|
|
159
|
+
{: .example-code}
|
|
160
|
+
|
|
161
|
+
Without the `--interactive` option, all matching results are printed as JSON. This mode is suitable for searching AppMap Data and printing results that can be piped into other scripts (e.g. using [jq](https://stedolan.github.io/jq/)) for further processing.
|
|
162
|
+
|
|
163
|
+
**Interactive mode arguments**
|
|
164
|
+
|
|
165
|
+
#### (h)ome
|
|
166
|
+
|
|
167
|
+
The home screen is displayed at the beginning of interactive mode. The `(h)ome` command will generally return you to the home screen, when you are in other parts of the app.
|
|
168
|
+
|
|
169
|
+
The home screen presents the following data:
|
|
170
|
+
|
|
171
|
+
| Field index | Field name | Description |
|
|
172
|
+
|-------------|------------|-------------|
|
|
173
|
+
| 1 | Events | A list of AppMap Diagrams and event indices that match the initial search term and filters. |
|
|
174
|
+
| 2 | Return values | Enumeration of all the different values returned by the matching object (most applicable when searching for a function). |
|
|
175
|
+
| 3 | HTTP server requests | Distinct routes in which the code object is found. Each listed result is a unique request method, normalized path, and status code. |
|
|
176
|
+
| 4 | SQL queries | Unique normalized SQL which is a descendant (or self) of the matching code object. |
|
|
177
|
+
| 5 | SQL tables | Unique tables which are found in the SQL queries, as defined in field 4. |
|
|
178
|
+
| 6 | Callers | Unique functions which are the parent of each matching code object. |
|
|
179
|
+
| 7 | Ancestors | Unique HTTP server requests and labeled functions which appear as an ancestor of a matching code object. |
|
|
180
|
+
| 8 | Descendants | Unique labeled functions which appear as a descendant of a matching code object. |
|
|
181
|
+
| 9 | Package trigrams | Unique combinations of caller → code-object → callee, converted to package names. |
|
|
182
|
+
| 10 | Class trigrams | Unique combinations of caller → code-object → callee, converted to class names. |
|
|
183
|
+
| 11 | Function trigrams | Unique combinations of caller → code-object → callee, as functions, SQL, or HTTP client requests. |
|
|
184
|
+
|
|
185
|
+
On the home screen, a field is displayed if there are only a small number of distinct values. Otherwise, the number of distinct values is shown, and you can use the `(p)rint` command to see the full details.
|
|
186
|
+
|
|
187
|
+
#### (p)rint
|
|
188
|
+
|
|
189
|
+
Prints the full details of a numbered field. Unlike the `(h)ome` view, which will summarize fields with many values, the `(p)rint` command will always print out all the distinct values of a field (even if there are thousands of them…).
|
|
190
|
+
|
|
191
|
+
#### (f)ilter
|
|
192
|
+
|
|
193
|
+
Applies a filter to the result set. You can use this command to reduce the number of search matches that are displayed, both on the `(h)ome` screen and in the `(p)rint` views.
|
|
194
|
+
|
|
195
|
+
When you choose the `(f)ilter` command, you’re first prompted to select which field you want to choose the filter value from. For example, you may see a table that includes `(2) Return values (3) HTTP server requests (6) Callers`. On choosing one of these fields, you are then prompted to select a value. The values will be the same as if you chose to `(p)rint` the selected field. Each field value is numbered; enter the number of the field value to activate it as a filter.
|
|
196
|
+
|
|
197
|
+
The result set is then recomputed, matching only events that match BOTH the main code-object argument that you initially provided to the search command, AND the filter.
|
|
198
|
+
|
|
199
|
+
For example, if you searched for `table:users` and then filtered by `request:GET /user 200`, the search would match every query that accesses the users table within an HTTP `GET` request to `/user` that returns status code `200`.
|
|
200
|
+
|
|
201
|
+
If you apply another filter, then BOTH filter conditions must match each result.
|
|
202
|
+
|
|
203
|
+
#### (u)ndo filter
|
|
204
|
+
|
|
205
|
+
Un-apply the most recently applied filter.
|
|
206
|
+
|
|
207
|
+
#### (r)eset filters
|
|
208
|
+
|
|
209
|
+
Remove all filters.
|
|
210
|
+
|
|
211
|
+
#### (q)uit
|
|
212
|
+
|
|
213
|
+
Quit the interactive program.
|
|
214
|
+
|
|
215
|
+
## `sequence-diagram`
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
appmap sequence-diagram <appmap...>
|
|
219
|
+
|
|
220
|
+
Generate a sequence diagram for an AppMap
|
|
221
|
+
|
|
222
|
+
Positionals:
|
|
223
|
+
appmap [array] [required] [default: []]
|
|
224
|
+
|
|
225
|
+
Options:
|
|
226
|
+
--version Show version number [boolean]
|
|
227
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
228
|
+
--help Show help [boolean]
|
|
229
|
+
-d, --directory program working directory [string]
|
|
230
|
+
--output-dir directory in which to save the sequence diagrams
|
|
231
|
+
--show-browser when using a browser to render the diagram, show the
|
|
232
|
+
browser window [boolean] [default: false]
|
|
233
|
+
--loops identify loops and collect under a Loop object
|
|
234
|
+
[boolean] [default: true]
|
|
235
|
+
-f, --format output format
|
|
236
|
+
[choices: "png", "plantuml", "json"] [default: "png"]
|
|
237
|
+
--filter Filter to use to prune the map [string]
|
|
238
|
+
--exclude code objects to exclude from the diagram [deprecated]
|
|
239
|
+
--expand code objects to expand in the diagram
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
For example, to generate a PNG of an AppMap named `example`, but with two packages named `com.techcom.models` and `com.techcom.views` expanded into their constituent classes on separate lifelines:
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
appmap sequence-diagram --expand package:com/techcom/models --expand package:com/techcom/views example.appmap.json
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### sequence-diagram-diff
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
appmap sequence-diagram-diff base-diagram head-diagram
|
|
252
|
+
|
|
253
|
+
Diff sequence diagrams that are represented as JSON
|
|
254
|
+
|
|
255
|
+
Positionals:
|
|
256
|
+
base-diagram base diagram file or directory to compare [required]
|
|
257
|
+
head-diagram head diagram file or directory to compare [required]
|
|
258
|
+
|
|
259
|
+
Options:
|
|
260
|
+
--version Show version number [boolean]
|
|
261
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
262
|
+
--help Show help [boolean]
|
|
263
|
+
-d, --directory program working directory [string]
|
|
264
|
+
--output-dir directory in which to save the sequence diagrams
|
|
265
|
+
[default: "."]
|
|
266
|
+
--format output format
|
|
267
|
+
[choices: "plantuml", "json"] [default: "plantuml"]
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
## `openapi`
|
|
272
|
+
|
|
273
|
+
```console
|
|
274
|
+
$ appmap openapi --help
|
|
275
|
+
```
|
|
276
|
+
{: .example-code}
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
appmap openapi
|
|
280
|
+
|
|
281
|
+
Generate OpenAPI from AppMap Data in a directory
|
|
282
|
+
|
|
283
|
+
Options:
|
|
284
|
+
--version Show version number [boolean]
|
|
285
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
286
|
+
--help Show help [boolean]
|
|
287
|
+
--appmap-dir directory to recursively inspect for AppMap Data
|
|
288
|
+
[default: "tmp/appmap"]
|
|
289
|
+
-o, --output-file output file name
|
|
290
|
+
--openapi-template template YAML; generated content will be placed in the
|
|
291
|
+
paths and components sections
|
|
292
|
+
--openapi-title info/title field of the OpenAPI document
|
|
293
|
+
--openapi-version info/version field of the OpenAPI document
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Use this command to generate OpenAPI documentation from all AppMap Data in a directory
|
|
297
|
+
(recursively explored).
|
|
298
|
+
|
|
299
|
+
`openapi` ships with a default `yml` template but you can use a custom template if
|
|
300
|
+
you specify its file with the optional `--openapi-template` parameter.
|
|
301
|
+
|
|
302
|
+
The `--openapi-title` and `--openapi-version` parameters override the values of the
|
|
303
|
+
`info/title` and `info/version` properties in the generated document.
|
|
304
|
+
|
|
305
|
+
## `stats`
|
|
306
|
+
|
|
307
|
+
Use this command to show statistics about events from a single AppMap Diagram or all diagrams in a directory.
|
|
308
|
+
|
|
309
|
+
### Usage
|
|
310
|
+
|
|
311
|
+
The `stats` command takes a directory of AppMap Data and will identify the largest diagrams, and will also
|
|
312
|
+
calculate which functions have the highest AppMap overhead. You can use this data alongside the `prune` command
|
|
313
|
+
to reduce the size of your AppMap Diagram or remove noisy functions. To target a specific AppMap use the `--appmap-file`
|
|
314
|
+
option with the name of the map.
|
|
315
|
+
|
|
316
|
+
For example:
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
To get statistics for all the AppMap Data in a directory, this will look recursively in all directories below `tmp/appmap`:
|
|
320
|
+
```
|
|
321
|
+
$ appmap stats tmp/appmap
|
|
322
|
+
✔ Computing AppMap stats...
|
|
323
|
+
|
|
324
|
+
Largest AppMaps (which are bigger than 1024kb)
|
|
325
|
+
1.5MB minitest/Microposts_interface_micropost_interface.appmap.json
|
|
326
|
+
1.5MB minitest/Valid_login_redirect_after_login.appmap.json
|
|
327
|
+
1.1MB minitest/Invalid_password_login_with_valid_email_invalid_password.appmap.json
|
|
328
|
+
|
|
329
|
+
✔ Computing functions with highest AppMap overhead...
|
|
330
|
+
|
|
331
|
+
Total instrumentation time
|
|
332
|
+
1947ms
|
|
333
|
+
|
|
334
|
+
Functions with highest AppMap overhead
|
|
335
|
+
Time | % | Count | Function name
|
|
336
|
+
546ms | 28.1% | 2082 | sprockets/Sprockets::EncodingUtils.unmarshaled_deflated
|
|
337
|
+
268ms | 13.8% | 2082 | ruby/Marshal.load
|
|
338
|
+
180ms | 9.2% | 3211 | ruby/Array#pack
|
|
339
|
+
154ms | 7.9% | 375 | actionview/ActionView::Resolver#find_all
|
|
340
|
+
85ms | 4.4% | 2054 | logger/Logger::LogDevice#write
|
|
341
|
+
64ms | 3.3% | 7 | app/mailers/UserMailer#account_activation
|
|
342
|
+
61ms | 3.1% | 120 | ruby/Marshal.dump
|
|
343
|
+
59ms | 3% | 9 | app/mailers/UserMailer#password_reset
|
|
344
|
+
58ms | 3% | 517 | openssl/OpenSSL::Random.random_bytes
|
|
345
|
+
52ms | 2.7% | 1042 | activesupport/ActiveSupport::Callbacks::CallbackSequence#invoke_after
|
|
346
|
+
```
|
|
347
|
+
{: .example-code}
|
|
348
|
+
|
|
349
|
+
To get stats for an individual AppMap, pass the full directory where the AppMap lives, and use the `--appmap-file` option
|
|
350
|
+
to list the name of the AppMap.
|
|
351
|
+
|
|
352
|
+
Example:
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
$ appmap stats tmp/appmap/pytest --appmap-file tests_integration_catalogue_test_category_TestCategoryFactory_test_can_use_alternative_separator.appmap.json
|
|
356
|
+
Analyzing AppMap: /tmp/appmap/pytest/tests_integration_catalogue_test_category_TestCategoryFactory_test_can_use_alternative_separator.appmap.json
|
|
357
|
+
|
|
358
|
+
1. function:oscar/apps/catalogue/abstract_models/AbstractCategory#get_ancestors_and_self
|
|
359
|
+
count: 131033
|
|
360
|
+
estimated size: 48.8 MB
|
|
361
|
+
|
|
362
|
+
2. function:oscar/apps/catalogue/categories.create_from_sequence
|
|
363
|
+
count: 3
|
|
364
|
+
estimated size: 1.2 KB
|
|
365
|
+
|
|
366
|
+
3. function:oscar/apps/catalogue/abstract_models/AbstractCategory#save
|
|
367
|
+
count: 3
|
|
368
|
+
estimated size: 1.7 KB
|
|
369
|
+
|
|
370
|
+
4. function:oscar/apps/catalogue/abstract_models/AbstractCategory#generate_slug
|
|
371
|
+
count: 3
|
|
372
|
+
estimated size: 1.1 KB
|
|
373
|
+
|
|
374
|
+
5. function:oscar/core/utils.slugify
|
|
375
|
+
count: 3
|
|
376
|
+
estimated size: 794.0 bytes
|
|
377
|
+
```
|
|
378
|
+
{: .example-code}
|
|
379
|
+
|
|
380
|
+
### Arguments
|
|
381
|
+
|
|
382
|
+
```console
|
|
383
|
+
$ appmap stats --help
|
|
384
|
+
```
|
|
385
|
+
{: .example-code}
|
|
386
|
+
|
|
387
|
+
```
|
|
388
|
+
appmap stats [directory]
|
|
389
|
+
|
|
390
|
+
Show statistics about events from an AppMap or from all diagrams in a directory
|
|
391
|
+
|
|
392
|
+
Options:
|
|
393
|
+
--version Show version number [boolean]
|
|
394
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
395
|
+
--help Show help [boolean]
|
|
396
|
+
-d, --directory program working directory [string]
|
|
397
|
+
--appmap-dir directory to recursively inspect for AppMap Data
|
|
398
|
+
-f, --format How to format the output
|
|
399
|
+
[choices: "json", "text"] [default: "text"]
|
|
400
|
+
-l, --limit Number of methods to display [number] [default: 10]
|
|
401
|
+
-a, --appmap-file AppMap to analyze [string]
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
## `prune`
|
|
405
|
+
|
|
406
|
+
Use this command to remove events from an AppMap, to make it have better performance, and to make it easier to understand.
|
|
407
|
+
|
|
408
|
+
Pruning works by finding the most repetitive calls in the map and then removing events associated with those calls. Non-application events such as HTTP requests and SQL queries will always be retained.
|
|
409
|
+
|
|
410
|
+
### Usage
|
|
411
|
+
|
|
412
|
+
The `prune` command expects either a `--size` argument or a `--filter` argument. It will not work if neither are provided. Using the `--size` argument allows you to automatically shrink the AppMap file to a specified file size, while the `--filter` option allows you to specify what events to remove.
|
|
413
|
+
|
|
414
|
+
### Arguments
|
|
415
|
+
|
|
416
|
+
You must provide either a `--size` argument or a `--filter` argument. You can find more information about the prune command by using the `--help` argument:
|
|
417
|
+
|
|
418
|
+
```console
|
|
419
|
+
$ appmap prune --help
|
|
420
|
+
```
|
|
421
|
+
{: .example-code}
|
|
422
|
+
|
|
423
|
+
```
|
|
424
|
+
appmap prune <file>
|
|
425
|
+
|
|
426
|
+
Make an appmap file smaller by removing events
|
|
427
|
+
|
|
428
|
+
Positionals:
|
|
429
|
+
file AppMap to prune [required]
|
|
430
|
+
|
|
431
|
+
Options:
|
|
432
|
+
--version Show version number [boolean]
|
|
433
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
434
|
+
--help Show help [boolean]
|
|
435
|
+
-o, --output-dir Specifies the output directory [string] [default: "."]
|
|
436
|
+
--format How to format the output
|
|
437
|
+
[choices: "json", "text"] [default: "text"]
|
|
438
|
+
-s, --size Prune input file to this size [string] [default: "15mb"]
|
|
439
|
+
-d, --directory Working directory for the command [string]
|
|
440
|
+
--filter Filter to use to prune the map [string]
|
|
441
|
+
--output-data Whether to output all AppMap Data or just output what was
|
|
442
|
+
removed [boolean]
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### Prune to a specific file size
|
|
446
|
+
|
|
447
|
+
The simplest way to use the `prune` command is to provide a target size for the map. The prune command will automatically
|
|
448
|
+
remove functions until the desired size is reached. Using the `prune` command in this way does not give you control over what
|
|
449
|
+
gets removed, but often times the removed functions are relatively uninteresting (getters, setters, etc.).
|
|
450
|
+
|
|
451
|
+
### Prune specific events
|
|
452
|
+
|
|
453
|
+
The most powerful way to use the `prune` command is to pass it specific instructions about which events to remove. This is done by
|
|
454
|
+
using the `--filter` option. Here are the steps for using this technique:
|
|
455
|
+
|
|
456
|
+
1. Open an AppMap in the code editor.
|
|
457
|
+
2. Use the filtering available in the AppMap to hide certain events. 
|
|
458
|
+
3. Open the command pallette using `CTRL+SHIFT+P` or `COMMAND+SHIFT+P` on macOS, type `AppMap: Copy Current AppMap State to Clipboard`, then hit `Enter`.
|
|
459
|
+
4. Use the copied state as the `--filter` argument to the `prune` command. The `prune` command will remove whatever was filtered in the AppMap in your code editor.
|
|
460
|
+
|
|
461
|
+
```shell
|
|
462
|
+
$ appmap prune <APPMAP_FILE> --filter eyJjdXJyZW50VmlldyI6InZpZXdTZXF1ZW5jZSIsImZpbHRlcnMi
|
|
463
|
+
```
|
|
464
|
+
{: .example-code}
|
|
465
|
+
|
|
466
|
+
## `archive`
|
|
467
|
+
|
|
468
|
+
Use this command locally, or in the [GitHub Action](/docs/integrations/github-actions) or [CircleCI](/docs/integrations/circle-ci), to build a compressed archive of AppMap Data from a directory containing AppMap Data. Running this command without additional options will result in a "full" archive created at `.appmap/archive/full/{git revision}.tar`. Example: `.appmap/archive/full/028e610386f2fc132c93e613f57011825a8ae6e0.tar`
|
|
469
|
+
|
|
470
|
+
### Usage
|
|
471
|
+
|
|
472
|
+
The `archive` command does not require any arguments to run, but must be run in a git project with a valid appmap.yml file with AppMap Data located in the directory defined by `appmap_dir:` in the configuration.
|
|
473
|
+
|
|
474
|
+
### Arguments
|
|
475
|
+
```
|
|
476
|
+
appmap archive
|
|
477
|
+
|
|
478
|
+
Build an AppMap archive from a directory containing AppMap Data
|
|
479
|
+
|
|
480
|
+
Options:
|
|
481
|
+
--version Show version number [boolean]
|
|
482
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
483
|
+
--help Show help [boolean]
|
|
484
|
+
-d, --directory program working directory [string]
|
|
485
|
+
-t, --type archive type
|
|
486
|
+
[choices: "full", "incremental", "auto"] [default: "auto"]
|
|
487
|
+
-r, --revision revision identifier.
|
|
488
|
+
|
|
489
|
+
If not explicitly specified, the current git revision
|
|
490
|
+
will be used.
|
|
491
|
+
When this command is used in an CI server, it's best
|
|
492
|
+
to explicitly the provide the revision
|
|
493
|
+
from an environment variable provided by the CI
|
|
494
|
+
system, such as GITHUB_HEAD_SHA, because the
|
|
495
|
+
commit of the current git revision may not be the one
|
|
496
|
+
that triggered the build. [string]
|
|
497
|
+
--output-dir directory in which to save the output file. By
|
|
498
|
+
default, it's .appmap/archive/<type>. [string]
|
|
499
|
+
-f, --output-file output file name. Default output name is
|
|
500
|
+
<revision>.tar [string]
|
|
501
|
+
--analyze, --index whether to analyze the AppMap Data
|
|
502
|
+
[boolean] [default: true]
|
|
503
|
+
--max-size maximum AppMap size that will be processed, in
|
|
504
|
+
filesystem-reported MB [default: 50]
|
|
505
|
+
--filter filter to apply to AppMap Data when normalizing them
|
|
506
|
+
into sequence diagrams [string]
|
|
507
|
+
--thread-count Number of worker threads to use when analyzing AppMap Data
|
|
508
|
+
[number]
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
## `restore`
|
|
512
|
+
Use this command locally, or in the [GitHub Action](/docs/integrations/github-actions) or [CircleCI](/docs/integrations/circle-ci), to download the most current available AppMap Data from the available archives. The archived AppMap Data can be stored locally or within a GitHub artifact store (if you are using the [GitHub Integration](/docs/integrations/github-actions)). The archive filename must match the git revision requested to be restored.
|
|
513
|
+
|
|
514
|
+
### Usage
|
|
515
|
+
|
|
516
|
+
The `restore` command does not require any arguments to run. By default, it will look for a valid AppMap tarball in the following location: `.appmap/archive/{full,incremental}/{git revision}.tar`. After finding a valid AppMap tarball in the default location, the command will extract the archive to the `.appmap/work/{git revision}` directory.
|
|
517
|
+
|
|
518
|
+
### Arguments
|
|
519
|
+
```
|
|
520
|
+
appmap restore
|
|
521
|
+
|
|
522
|
+
Restore the most current available AppMap Data from available archives
|
|
523
|
+
|
|
524
|
+
Options:
|
|
525
|
+
--version Show version number [boolean]
|
|
526
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
527
|
+
--help Show help [boolean]
|
|
528
|
+
-d, --directory program working directory [string]
|
|
529
|
+
-r, --revision revision to restore [string]
|
|
530
|
+
--output-dir directory in which to restore the data. Default:
|
|
531
|
+
.appmap/work/<revision> [string]
|
|
532
|
+
--archive-dir directory in which the archives are stored
|
|
533
|
+
[string] [default: ".appmap/archive"]
|
|
534
|
+
--github-repo Fetch AppMap archives from artifacts on a GitHub
|
|
535
|
+
repository. GITHUB_TOKEN must be set for this option to
|
|
536
|
+
work. [string]
|
|
537
|
+
--exact fail unless the specific revision requested is available to
|
|
538
|
+
be restored [boolean] [default: false]
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
## `compare`
|
|
542
|
+
|
|
543
|
+
Use this command locally, or in the [GitHub Action](/docs/integrations/github-actions) or [CircleCI](/docs/integrations/circle-ci), to compare code behavior by analyzing two sets of AppMap Diagrams from different git revisions.
|
|
544
|
+
### Usage
|
|
545
|
+
|
|
546
|
+
The `compare` command requires `--base-revision` to be passed to the command with a valid git SHA (i.e. `028e610386f2fc132c93e613f57011825a8ae6e0`). The head revision will be inferred based on the current git HEAD SHA for the git project in the current working directory.
|
|
547
|
+
|
|
548
|
+
When comparing two git revisions, you will need to use the [`restore`](#restore) command configuration flag `--output-dir` and set the output directory to `appmap/change-report/$base_revision-$head_revision/{base,head}`. For example if your base revision is `c01273ab4929e7d555aa8539f83c188aba42972d` and your head revision is `028e610386f2fc132c93e613f57011825a8ae6e0`, you will need to run the restore command on both revisions making sure your `--output-dir` looks like the following:
|
|
549
|
+
|
|
550
|
+
For the head revision (i.e. `028e610386f2fc132c93e613f57011825a8ae6e0`):
|
|
551
|
+
`--output-dir .appmap/change-report/$base_revision-$head_revision/head`
|
|
552
|
+
Example:
|
|
553
|
+
`--output-dir .appmap/change-report/c01273ab4929e7d555aa8539f83c188aba42972d-028e610386f2fc132c93e613f57011825a8ae6e0/head`
|
|
554
|
+
|
|
555
|
+
For the base revision (i.e. `c01273ab4929e7d555aa8539f83c188aba42972d`):
|
|
556
|
+
`--output-dir .appmap/change-report/$base_revision-$head_revision/base`
|
|
557
|
+
Example:
|
|
558
|
+
`--output-dir .appmap/change-report/028e610386f2fc132c93e613f57011825a8ae6e0-c01273ab4929e7d555aa8539f83c188aba42972d/base`
|
|
559
|
+
|
|
560
|
+
Both `base` and `head` directories will require restored AppMap Data before `compare` will run.
|
|
561
|
+
|
|
562
|
+
After successfully running, `compare` will output a `diff` directory of AppMap Diagrams and a `change-report.json` within the `.appmap/change-report/$base_revision-$head_revision/` directory.
|
|
563
|
+
|
|
564
|
+
### Arguments
|
|
565
|
+
```
|
|
566
|
+
appmap compare
|
|
567
|
+
|
|
568
|
+
Compare runtime code behavior between base and head revisions
|
|
569
|
+
|
|
570
|
+
Options:
|
|
571
|
+
--version Show version number [boolean]
|
|
572
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
573
|
+
--help Show help [boolean]
|
|
574
|
+
-d, --directory program working directory [string]
|
|
575
|
+
-b, --base-revision, --base base revision name or commit SHA.
|
|
576
|
+
[required]
|
|
577
|
+
-h, --head-revision, --head head revision name or commit SHA. By
|
|
578
|
+
default, use the current commit.
|
|
579
|
+
--output-dir directory in which to save the
|
|
580
|
+
report files. Default is
|
|
581
|
+
./.appmap/change-report/<base-revisi
|
|
582
|
+
on>-<head-revision>.
|
|
583
|
+
--clobber-output-dir remove the output directory if it
|
|
584
|
+
exists [boolean] [default: false]
|
|
585
|
+
--source-dir root directory of the application
|
|
586
|
+
source code [string] [default: "."]
|
|
587
|
+
--delete-unreferenced, whether to delete AppMap Data from
|
|
588
|
+
--delete-unchanged base and head that are unreferenced by
|
|
589
|
+
the change report [default: true]
|
|
590
|
+
--report-removed whether to report removed findings,
|
|
591
|
+
such as removed API routes, resolved
|
|
592
|
+
findings, etc [default: true]
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
## `compare-report`
|
|
596
|
+
|
|
597
|
+
Use this command locally, or in the [GitHub Action](/docs/integrations/github-actions) or [CircleCI](/docs/integrations/circle-ci), to generate a report document from comparison data generated by the [compare](#compare) command.
|
|
598
|
+
|
|
599
|
+
### Usage
|
|
600
|
+
|
|
601
|
+
The `compare-report` command expects the `compare` command to have successfully executed against two git revisions and generated a `change-report.json` file. The `compare-report` command expects the first argument passed to it is the directory containing the `change-report.json`.
|
|
602
|
+
|
|
603
|
+
Example: `appmap compare-report .appmap/change-report/$base_revision-$head_revision`
|
|
604
|
+
|
|
605
|
+
### Arguments
|
|
606
|
+
```
|
|
607
|
+
appmap compare-report <report-directory>
|
|
608
|
+
|
|
609
|
+
Generate a report document from comparison data generated by the compare
|
|
610
|
+
command.
|
|
611
|
+
|
|
612
|
+
Positionals:
|
|
613
|
+
report-directory directory containing the comparison data [string] [required]
|
|
614
|
+
|
|
615
|
+
Options:
|
|
616
|
+
--version Show version number [boolean]
|
|
617
|
+
-v, --verbose Run with verbose logging [boolean]
|
|
618
|
+
--help Show help [boolean]
|
|
619
|
+
--source-url Base URL to link to a source file. The relative path to the
|
|
620
|
+
source file will be added to the URL path. [string]
|
|
621
|
+
--appmap-url Base URL to link to AppMap Data. A 'path' parameter will be
|
|
622
|
+
added with the relative path from the report directory to
|
|
623
|
+
the AppMap JSON file. [string]
|
|
624
|
+
-d, --directory program working directory [string]
|
|
625
|
+
```
|
|
626
|
+
## GitHub repository
|
|
627
|
+
|
|
628
|
+
[https://github.com/getappmap/appmap-js/tree/main/packages/cli](https://github.com/getappmap/appmap-js/tree/main/packages/cli)
|