@appland/appmap 3.143.0 → 3.145.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 +21 -0
- package/built/cmds/navie/help.js +6 -1
- package/built/cmds/navie/help.js.map +1 -1
- package/built/cmds/navie.js +9 -4
- package/built/cmds/navie.js.map +1 -1
- package/built/rpc/explain/navie/navie-local.js +14 -14
- package/built/rpc/explain/navie/navie-local.js.map +1 -1
- package/package.json +2 -2
- 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 +0 -27
- package/built/docs/appmap-docs.md +0 -27
- package/built/docs/community.md +0 -28
- package/built/docs/guides/exporting-appmap-diagrams.md +0 -50
- package/built/docs/guides/handling-large-appmap-diagrams.md +0 -138
- package/built/docs/guides/index.md +0 -21
- package/built/docs/guides/navigating-code-objects.md +0 -67
- package/built/docs/guides/openapi.md +0 -105
- package/built/docs/guides/reading-sql-in-appmap-diagrams.md +0 -69
- package/built/docs/guides/refine-appmap-data.md +0 -186
- package/built/docs/guides/reverse-engineering.md +0 -377
- package/built/docs/guides/runtime-code-review.md +0 -111
- package/built/docs/guides/using-appmap-analysis.md +0 -206
- package/built/docs/guides/using-appmap-diagrams.md +0 -331
- package/built/docs/integrations/atlassian-compass.md +0 -25
- package/built/docs/integrations/atlassian-confluence.md +0 -51
- package/built/docs/integrations/circle-ci.md +0 -424
- package/built/docs/integrations/docker.md +0 -109
- package/built/docs/integrations/github-actions.md +0 -524
- package/built/docs/integrations/index.md +0 -20
- package/built/docs/integrations/plantuml.md +0 -66
- package/built/docs/integrations/postman.md +0 -30
- package/built/docs/integrations/readme.md +0 -39
- package/built/docs/integrations/smartbear-swaggerhub.md +0 -119
- package/built/docs/reference/analysis-labels.md +0 -49
- package/built/docs/reference/analysis-rules.md +0 -61
- package/built/docs/reference/appmap-client-cli.md +0 -628
- package/built/docs/reference/appmap-gradle-plugin.md +0 -141
- package/built/docs/reference/appmap-java.md +0 -311
- package/built/docs/reference/appmap-maven-plugin.md +0 -164
- package/built/docs/reference/appmap-node.md +0 -185
- package/built/docs/reference/appmap-python.md +0 -520
- package/built/docs/reference/appmap-ruby.md +0 -514
- package/built/docs/reference/github-action.md +0 -171
- package/built/docs/reference/index.md +0 -25
- package/built/docs/reference/jetbrains.md +0 -136
- package/built/docs/reference/license-key-install.md +0 -74
- package/built/docs/reference/navie.md +0 -261
- package/built/docs/reference/remote-recording-api.md +0 -97
- package/built/docs/reference/uninstalling-appmap.md +0 -119
- package/built/docs/reference/vscode.md +0 -122
- package/built/docs/setup-appmap-in-ci/example-projects.md +0 -21
- package/built/docs/setup-appmap-in-ci/how-it-works.md +0 -43
- package/built/docs/setup-appmap-in-ci/in-circleci.md +0 -423
- package/built/docs/setup-appmap-in-ci/in-github-actions.md +0 -177
- package/built/docs/setup-appmap-in-ci/index.md +0 -22
- package/built/docs/setup-appmap-in-ci/matrix-builds.md +0 -225
- package/built/docs/setup-appmap-in-ci/troubleshooting.md +0 -71
- package/built/docs/setup-appmap-in-your-code-editor/add-appmap-to-your-code-editor.md +0 -93
- package/built/docs/setup-appmap-in-your-code-editor/appmap-analysis.md +0 -77
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmap-data-from-tests.md +0 -93
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmap-data-with-remote-recording.md +0 -112
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmap-data-with-request-recording.md +0 -77
- package/built/docs/setup-appmap-in-your-code-editor/how-appmap-works.md +0 -166
- package/built/docs/setup-appmap-in-your-code-editor/index.md +0 -25
- package/built/docs/setup-appmap-in-your-code-editor/navigating-appmap-diagrams.md +0 -59
- package/built/docs/setup-appmap-in-your-code-editor/navigating-code-objects.md +0 -67
- package/built/docs/unused_for_now_index.html +0 -11
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Docs - Guides
|
|
4
|
-
description: "Use AppMap to auto generate OpenAPI definitions and document HTTP APIs. AppMap captures runtime behavior, creating accurate API schemas effortlessly."
|
|
5
|
-
guides: true
|
|
6
|
-
name: Generating OpenAPI Definitions
|
|
7
|
-
step: 7
|
|
8
|
-
redirect_from: [/docs/openapi,/docs/openapi/features,/docs/openapi/code-editor-extensions,/docs/openapi/integrations,/docs/openapi/customization,/docs/reference/openapi]
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# Generating OpenAPI Definitions <!-- omit in toc -->
|
|
13
|
-
|
|
14
|
-
> "The OpenAPI specification, which is formerly known as Swagger Specification, is a community-driven open standard, programming language-agnostic interface description for HTTP APIs. This allows both humans and computers to discover and understand the capabilities of a service without requiring access to the source code."
|
|
15
|
-
|
|
16
|
-
Because AppMap records your code's runtime behavior, it can see and record all of the HTTP API calls processed including the schema of each request and response. Creating OpenAPI definitions by hand is error prone and time consuming. Keeping them up to date is additional work that quickly falls out of sync with the code. Using the AppMap we can automatically output OpenAPI definitions for an application.
|
|
17
|
-
|
|
18
|
-
- [Requirements](#requirements)
|
|
19
|
-
- [Schema](#schema)
|
|
20
|
-
- [Use Cases](#use-cases)
|
|
21
|
-
- [Pull Request Review](#pull-request-review)
|
|
22
|
-
- [Update Documentation Automatically](#update-documentation-automatically)
|
|
23
|
-
- [Send to 3rd Party Services](#send-to-3rd-party-services)
|
|
24
|
-
- [Generating definitions](#generating-definitions)
|
|
25
|
-
- [Integrations](#integrations)
|
|
26
|
-
- [Customization](#customization)
|
|
27
|
-
- [Operation `summary`](#operation-summary)
|
|
28
|
-
|
|
29
|
-
## Requirements
|
|
30
|
-
|
|
31
|
-
1. AppMap Data generated from your application that includes calls to your API endpoints. (Refer to the AppMap documentation on [how to record your application](/docs/recording-methods))
|
|
32
|
-
2. The latest version of the [AppMap binaries downloaded.](https://github.com/getappmap/appmap-js/releases?q=@appland/appmap*&expanded=true) (For the CLI usage)
|
|
33
|
-
3. The latest version of the AppMap code editor extension (for code editor usage)
|
|
34
|
-
|
|
35
|
-
## Schema
|
|
36
|
-
|
|
37
|
-
The generated OpenAPI schema only includes information (paths, methods, status codes, parameters, responses, headers, security) that have actually been observed in the AppMap Data. So, if a particular code behavior has not been observed by AppMap, it won't be present in the OpenAPI.
|
|
38
|
-
|
|
39
|
-
When AppMap Data is collected by running test cases, the generated OpenAPI will reflect the code coverage of the application with regard to its APIs. If an expected path, method, status or parameter is not observed in the generated OpenAPI, you'll know it's missing because it's not tested.
|
|
40
|
-
|
|
41
|
-
Object schema is inferred from runtime data. When there are many examples of a request, the inferred schema of all the examples is merged into one unified schema.
|
|
42
|
-
|
|
43
|
-
Both request and response schema are available.
|
|
44
|
-
|
|
45
|
-
## Use Cases
|
|
46
|
-
|
|
47
|
-
### Pull Request Review
|
|
48
|
-
|
|
49
|
-
We suggest you generate OpenAPI for all new work, and commit the _openapi.yaml_ file to source control. When a pull request contains API changes, a diff view of the OpenAPI changes is a very useful way for code reviewers to quickly get the "big picture" of the new branch.
|
|
50
|
-
|
|
51
|
-
### Update Documentation Automatically
|
|
52
|
-
|
|
53
|
-
By generating OpenAPI definitions as part of your continuous integration process, you can ensure that your documentation continually updates automatically as the code updates. This reduces unnecessary engineering toil working to keep documentation up to date manually.
|
|
54
|
-
|
|
55
|
-
### Send to 3rd Party Services
|
|
56
|
-
|
|
57
|
-
Integrate AppMap OpenAPI generation with various 3rd party services to share OpenAPI documentation with your end users or validate and diff changes over time. [Refer to the documentation](/docs/integrations/) to learn how to incorporate AppMap OpenAPI generation with various 3rd party services.
|
|
58
|
-
|
|
59
|
-
## Generating definitions
|
|
60
|
-
|
|
61
|
-
* [AppMap extension for VSCode](/docs/reference/vscode.html#generate-openapi-definitions)
|
|
62
|
-
* [AppMap extension for JetBrains](/docs/reference/jetbrains.html#generate-openapi-definitions)
|
|
63
|
-
* [AppMap CLI](/docs/reference/appmap-client-cli.html#openapi)
|
|
64
|
-
|
|
65
|
-
## Integrations
|
|
66
|
-
|
|
67
|
-
Refer to the AppMap [integrations documentation](/docs/integrations/) to learn more about how to integrate your OpenAPI documentation with other 3rd party software and services.
|
|
68
|
-
|
|
69
|
-
## Customization
|
|
70
|
-
|
|
71
|
-
### Operation `summary`
|
|
72
|
-
|
|
73
|
-
To populate [`operation.summary`](https://swagger.io/specification/#operation-object), set the header `X-OpenAPI-Summary` in your response.
|
|
74
|
-
|
|
75
|
-
**Example**
|
|
76
|
-
|
|
77
|
-
_Ruby on Rails Controller_
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
class AccountActivationsController < ApplicationController
|
|
81
|
-
def edit
|
|
82
|
-
response.headers['X-OpenAPI-Summary'] = 'Activate the account of an existing user'
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
_openapi.yaml_
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
/account_activations/{id}/edit:
|
|
89
|
-
get:
|
|
90
|
-
responses:
|
|
91
|
-
'302':
|
|
92
|
-
content: {}
|
|
93
|
-
description: Found
|
|
94
|
-
parameters:
|
|
95
|
-
- name: email
|
|
96
|
-
in: query
|
|
97
|
-
schema:
|
|
98
|
-
type: string
|
|
99
|
-
- name: id
|
|
100
|
-
in: path
|
|
101
|
-
schema:
|
|
102
|
-
type: string
|
|
103
|
-
required: true
|
|
104
|
-
summary: Activate the account of an existing user
|
|
105
|
-
```
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Docs - Guides
|
|
4
|
-
description: "Discover SQL commands in AppMap Diagrams to analyze application logic's database interactions, spot inefficiencies, and understand code impacts for improved performance and reliability."
|
|
5
|
-
guides: true
|
|
6
|
-
name: Reading SQL in AppMap Diagrams
|
|
7
|
-
step: 5
|
|
8
|
-
redirect_from: [/docs/guides/reading-sql-in-appmaps]
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Reading SQL in AppMap Diagrams
|
|
12
|
-
The AppMap extension for your editor displays SQL commands in AppMap Diagrams so you can understand how your application logic interacts with the database. You can quickly discover SQL inefficiencies and anti-patterns that pose hidden scalability and reliability risks even if your application seems to be working well.
|
|
13
|
-
|
|
14
|
-
With the AppMap extension, not only are trips to database logs no longer required to see the SQL commands, but the SQL commands are also directly linked to the code that initiates their execution, helping developers understand the direct impacts of their code updates on database operations and performance.
|
|
15
|
-
|
|
16
|
-
### View all SQL commands, pick a command of interest, and drill down to details
|
|
17
|
-
When you open an AppMap, the navigation bar lists all captured SQL commands. This is a great starting point for your SQL investigation:
|
|
18
|
-
- Browse the list of SQL commands, pick a command, and click on it to drill down to details
|
|
19
|
-
- View the SQL command in the Trace to see how it is connected to upstream/downstream code and other SQL commands
|
|
20
|
-
- Click on the Caller link to see the function call that initiated the command’s execution.
|
|
21
|
-
|
|
22
|
-
<div class="video-container">
|
|
23
|
-
<video playsinline loop autoplay muted>
|
|
24
|
-
<source src="/assets/img/docs/view-all-sql-commands.mp4" type="video/mp4">
|
|
25
|
-
</video>
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
### Search for specific SQL commands/tables/columns
|
|
29
|
-
Use the search box in the Navigation bar to select for a specific subset of SQL Commands:
|
|
30
|
-
- Search for a specific SQL command such as SELECT, UPDATE, INSERT, etc.
|
|
31
|
-
- Search for a table or column name
|
|
32
|
-
- Use regular expressions for complex searches, filtering the results by multiple criteria, for example, `SELECT.*_orders.*`
|
|
33
|
-
|
|
34
|
-
<div class="video-container">
|
|
35
|
-
<video playsinline loop autoplay muted>
|
|
36
|
-
<source src="/assets/img/docs/search-for-specific-sql-commands.mp4" type="video/mp4">
|
|
37
|
-
</video>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
### View SQL commands executed by a specific class or package
|
|
41
|
-
When you click on a dependency link in the Dependency Map, the navigation bar will list events specific to that relationship.
|
|
42
|
-
- Select a link between the database icon and a class to see SQL commands executed by functions of that class
|
|
43
|
-
- Click on a SQL command to drill down to details.
|
|
44
|
-
|
|
45
|
-
<div class="video-container">
|
|
46
|
-
<video playsinline loop autoplay muted>
|
|
47
|
-
<source src="/assets/img/docs/view-specific-sql-executed-by-class.mp4" type="video/mp4">
|
|
48
|
-
</video>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
### Spot complex SQL patterns
|
|
52
|
-
When investigating how efficiently the application code or the ORM utilizes the database, it’s helpful to see whether multiple SQL commands are clustered together and whether they form any specific (anti-)patterns. The Trace view is a great visual tool for spotting clusters and repetitions of SQL commands enveloped by code that are difficult to discover using database logs or other simple tools.
|
|
53
|
-
- In the AppMap, switch to the Trace view
|
|
54
|
-
- Start with any of the SQL commands in the navigation bar and investigate how they are connected with other SQL commands or code blocks
|
|
55
|
-
- When looking for N+1-like patterns, look for repetitive SQL `SELECT`s fetching single records using a specific ID
|
|
56
|
-
- Use the zoom controls, arrow keys, panning, and expand/collapse functions to navigate around the trace efficiently.
|
|
57
|
-
|
|
58
|
-
#### Navigate the trace efficiently
|
|
59
|
-
<div class="video-container">
|
|
60
|
-
<video playsinline loop autoplay muted>
|
|
61
|
-
<source src="/assets/img/docs/navigate-the-trace-efficiently.mp4" type="video/mp4">
|
|
62
|
-
</video>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
### Example: How to spot and fix Django ORM anti-patterns
|
|
67
|
-
In this video example, you can learn how to optimize Django ORM by seeing how it makes SQL queries under the hood. The video explains the role of ORM in modern applications, SQL efficiency challenges, and how to use AppMap for uncovering and fixing the infamous N+1 anti-pattern
|
|
68
|
-
|
|
69
|
-
<div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/3872950e96174da4a714211b2af7f56e" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Docs - Guides
|
|
4
|
-
description: "Optimize AppMap Diagrams by refining recordings to exclude noise. Start with inclusive config, analyze stats, update config, create concise AppMap Diagrams."
|
|
5
|
-
guides: true
|
|
6
|
-
name: Refining AppMap Data
|
|
7
|
-
step: 6
|
|
8
|
-
redirect_from: [/docs/reference/refine-appmaps, /docs/guides/refine-appmaps]
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Refining AppMap Data <!-- omit in toc -->
|
|
12
|
-
|
|
13
|
-
When you initially create a client configuration, it can be hard to know what classes to
|
|
14
|
-
include. Most often, you will simply select everything just to see what a recording looks
|
|
15
|
-
like. The resulting AppMap Diagrams can be quite large and noisy. The presence of calls to many
|
|
16
|
-
utility methods makes it hard to understand the bigger picture.
|
|
17
|
-
|
|
18
|
-
To refine your recordings, it's best to start with the smallest use-case that's
|
|
19
|
-
representative of the entire application. For example, while a single unit test will
|
|
20
|
-
produce a small recording, such tests typically avoid accessing external resources
|
|
21
|
-
(e.g. web services, a database, or the file system) for the sake of speed. Recording a
|
|
22
|
-
single functional or integration test is a better choice.
|
|
23
|
-
|
|
24
|
-
Once you've made a recording of a use-case, you can use the `stats` subcommand
|
|
25
|
-
of the [AppMap CLI](/docs/reference/appmap-client-cli.html).
|
|
26
|
-
tools to generate some simple statistics about your AppMap Data. Based on these statistics,
|
|
27
|
-
you will be able to update your configuration so that less-interesting methods are
|
|
28
|
-
excluded. When new recordings are created with the improved configuration, they will be
|
|
29
|
-
more concise and easier to understand.
|
|
30
|
-
|
|
31
|
-
To illustrate the refinement process, we'll look at a recording made for
|
|
32
|
-
[Jenkins](https://github.com/land-of-apps/jenkins). [CONTRIBUTING.md](https://github.com/land-of-apps/jenkins/blob/master/CONTRIBUTING.md#testing-changes)
|
|
33
|
-
in that repository mentions that there are functional tests in the `test` module. For this
|
|
34
|
-
example, we'll use the tests in
|
|
35
|
-
[test/src/test/java/hudson/model/DirectlyModifiableViewTest.java](https://github.com/land-of-apps/jenkins/blob/master/test/src/test/java/hudson/model/DirectlyModifiableViewTest.java).
|
|
36
|
-
|
|
37
|
-
- [Step 1: Make a recording with an inclusive configuration](#step-1-make-a-recording-with-an-inclusive-configuration)
|
|
38
|
-
- [Step 2: Eliminate the noise](#step-2-eliminate-the-noise)
|
|
39
|
-
- [Step 3: Update the configuration and create new AppMap Diagrams](#step-3-update-the-configuration-and-create-new-appmap-diagrams)
|
|
40
|
-
|
|
41
|
-
## Step 1: Make a recording with an inclusive configuration
|
|
42
|
-
|
|
43
|
-
We'll start with a very broad configuration specified in
|
|
44
|
-
`appmap.yml`:
|
|
45
|
-
|
|
46
|
-
```yaml
|
|
47
|
-
name: Jenkins
|
|
48
|
-
packages:
|
|
49
|
-
- path: org.acegisecurity.context
|
|
50
|
-
- path: hudson
|
|
51
|
-
- path: jenkins
|
|
52
|
-
```
|
|
53
|
-
{: .example-code}
|
|
54
|
-
|
|
55
|
-
These are the three top-level packages used by Jenkins. We include them to make sure all
|
|
56
|
-
calls to methods that might be interesting get recorded.
|
|
57
|
-
|
|
58
|
-
Running the tests in `DirectlyModifiableViewTest.java` produces five very large AppMap Diagrams:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
% mvn test -Dtest=DirectlyModifiableViewTest
|
|
62
|
-
...
|
|
63
|
-
% ls -lsh | sort -n
|
|
64
|
-
total 310312
|
|
65
|
-
11456 -rw-r--r-- 1 ajp staff 5.6M Nov 11 10:04 hudson_model_DirectlyModifiableViewTest_manipulateViewContent.appmap.json
|
|
66
|
-
32952 -rw-r--r-- 1 ajp staff 16M Nov 11 10:04 hudson_model_DirectlyModifiableViewTest_doAddJobToView.appmap.json
|
|
67
|
-
41240 -rw-r--r-- 1 ajp staff 20M Nov 11 10:04 hudson_model_DirectlyModifiableViewTest_doRemoveJobFromView.appmap.json
|
|
68
|
-
109864 -rw-r--r-- 1 ajp staff 53M Nov 11 10:04 hudson_model_DirectlyModifiableViewTest_doAddNestedJobToRecursiveView.appmap.json
|
|
69
|
-
114800 -rw-r--r-- 1 ajp staff 56M Nov 11 10:05 hudson_model_DirectlyModifiableViewTest_failWebMethodForIllegalRequest.appmap.jso
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
The statistics for these show that there's substantial noise in them:
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
% appmap stats tmp/appmap
|
|
76
|
-
232356 calls, top 20 methods
|
|
77
|
-
hudson.util.AdaptedIterator#hasNext:50: 30433 (1 distinct)
|
|
78
|
-
hudson.util.Iterators$5#hasNext:295: 30433 (1 distinct)
|
|
79
|
-
hudson.ExtensionComponent#getInstance:73: 25040 (1 distinct)
|
|
80
|
-
hudson.util.AdaptedIterator#next:54: 24779 (1 distinct)
|
|
81
|
-
hudson.util.Iterators$5#next:299: 24779 (1 distinct)
|
|
82
|
-
jenkins.model.Jenkins$3#getInstance:763: 8101 (1 distinct)
|
|
83
|
-
jenkins.security.stapler.StaticRoutingDecisionProvider#decide:85: 7913 (1838 distinct)
|
|
84
|
-
jenkins.model.Jenkins#getExtensionList:2702: 5963 (15 distinct)
|
|
85
|
-
hudson.ExtensionList#iterator:172: 5849 (1 distinct)
|
|
86
|
-
hudson.util.Iterators.readOnly:293: 5849 (5849 distinct)
|
|
87
|
-
hudson.ExtensionList.lookup:433: 5831 (14 distinct)
|
|
88
|
-
hudson.ExtensionList#size:191: 5452 (1 distinct)
|
|
89
|
-
jenkins.security.stapler.DoActionFilter#keep:54: 2445 (2445 distinct)
|
|
90
|
-
jenkins.security.stapler.TypedFilter#keep:193: 2352 (2352 distinct)
|
|
91
|
-
jenkins.model.Jenkins.get:775: 1702 (1 distinct)
|
|
92
|
-
hudson.util.RobustReflectionConverter$1#visit:193: 1517 (122 distinct)
|
|
93
|
-
hudson.util.RobustReflectionConverter$2#visit:211: 1517 (122 distinct)
|
|
94
|
-
hudson.util.xstream.MapperDelegate#getConverterFromItemType:103: 1517 (28 distinct)
|
|
95
|
-
hudson.util.xstream.MapperDelegate#getConverterFromItemType:123: 1517 (73 distinct)
|
|
96
|
-
hudson.util.xstream.MapperDelegate#getConverterFromItemType:95: 1517 (67 distinct)
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
The top 20 methods in these files are called more than 1500 times! Removing them from the
|
|
100
|
-
recordings will make the AppMap Diagrams easier to understand, without eliminating any
|
|
101
|
-
interesting information.
|
|
102
|
-
|
|
103
|
-
## Step 2: Eliminate the noise
|
|
104
|
-
|
|
105
|
-
We'll start by generating more detailed statistics:
|
|
106
|
-
|
|
107
|
-
```sh
|
|
108
|
-
% appmap stats --limit 0 --files --json tmp/appmap > jenkins-unfiltered-stats.json
|
|
109
|
-
```
|
|
110
|
-
{: .example-code}
|
|
111
|
-
|
|
112
|
-
The output will contain statistics for all calls in all files, formatted as JSON.
|
|
113
|
-
|
|
114
|
-
Next, examine the statistics to look for methods that can be considered for exclusion:
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
% jq -r '.totals[] | select(.calls > 75) | " - \(.method)"' jenkins-unfiltered-stats.json | sort | uniq > exclusions.yml
|
|
118
|
-
% grep hudson exclusions.yml | head -5
|
|
119
|
-
- hudson.ExpressionFactory2#createExpression
|
|
120
|
-
- hudson.ExpressionFactory2$JellyJexlContext#getVars
|
|
121
|
-
- hudson.ExpressionFactory2$JellyMap#get
|
|
122
|
-
- hudson.ExpressionFactory2$JexlExpression#evaluate
|
|
123
|
-
- hudson.ExtensionComponent#getInstance
|
|
124
|
-
% grep jenkins exclusions.yml | head -5
|
|
125
|
-
- jenkins.MetaLocaleDrivenResourceProvider#lookup
|
|
126
|
-
- jenkins.model.Jenkins#getACL
|
|
127
|
-
- jenkins.model.Jenkins#getAuthorizationStrategy
|
|
128
|
-
- jenkins.model.Jenkins#getCrumbIssuer
|
|
129
|
-
- jenkins.model.Jenkins#getDescriptor
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
This finds methods that are called more than 75 times and saves them in a useful
|
|
133
|
-
form. Sorting them makes them easier to include in `appmap.yml`. Duplicate
|
|
134
|
-
method names will appear in the recording because of method overloading, but it's not
|
|
135
|
-
necessary to list them separately in the configuration. They can be removed.
|
|
136
|
-
|
|
137
|
-
Note that there's nothing special about the 75-call threshold used to select calls for
|
|
138
|
-
exclusion. Depending on your application, a different value may produce better results.
|
|
139
|
-
|
|
140
|
-
## Step 3: Update the configuration and create new AppMap Diagrams
|
|
141
|
-
|
|
142
|
-
The new configuration in `appmap.yml` gets updated to look like this:
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
name: Jenkins
|
|
146
|
-
packages:
|
|
147
|
-
- path: org.acegisecurity.context
|
|
148
|
-
exclude:
|
|
149
|
-
- org.acegisecurity.context.SecurityContextHolder.setContext
|
|
150
|
-
- org.acegisecurity.context.SecurityContextImpl#getAuthentication
|
|
151
|
-
- org.acegisecurity.context.ThreadLocalSecurityContextHolderStrategy#getContext
|
|
152
|
-
- org.acegisecurity.context.ThreadLocalSecurityContextHolderStrategy#setContext
|
|
153
|
-
|
|
154
|
-
- path: hudson
|
|
155
|
-
exclude:
|
|
156
|
-
- hudson.ExpressionFactory2#createExpression
|
|
157
|
-
- hudson.ExpressionFactory2$JellyJexlContext#getVars
|
|
158
|
-
- hudson.ExpressionFactory2$JellyMap#get
|
|
159
|
-
- hudson.ExpressionFactory2$JexlExpression#evaluate
|
|
160
|
-
...
|
|
161
|
-
- path: jenkins
|
|
162
|
-
exclude:
|
|
163
|
-
- jenkins.MetaLocaleDrivenResourceProvider#lookup
|
|
164
|
-
- jenkins.model.Jenkins#getACL
|
|
165
|
-
- jenkins.model.Jenkins#getAuthorizationStrategy
|
|
166
|
-
- jenkins.model.Jenkins#getCrumbIssuer
|
|
167
|
-
...
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
where the `exclude` sections should contain all the appropriate exclusions from
|
|
172
|
-
`exclusions.yml`.
|
|
173
|
-
|
|
174
|
-
With the configuration in place, rerun the tests and see the results:
|
|
175
|
-
|
|
176
|
-
```
|
|
177
|
-
% mvn test -Dtest=NodeCanTakeTaskTest
|
|
178
|
-
...
|
|
179
|
-
% ls -lsh tmp/appmap | sort -n
|
|
180
|
-
total 11176
|
|
181
|
-
776 -rw-r--r-- 1 ajp staff 329K Nov 11 10:41 hudson_model_DirectlyModifiableViewTest_doRemoveJobFromView.appmap.json
|
|
182
|
-
776 -rw-r--r-- 1 ajp staff 370K Nov 11 10:41 hudson_model_DirectlyModifiableViewTest_doAddJobToView.appmap.json
|
|
183
|
-
1416 -rw-r--r-- 1 ajp staff 693K Nov 11 10:41 hudson_model_DirectlyModifiableViewTest_manipulateViewContent.appmap.json
|
|
184
|
-
4104 -rw-r--r-- 1 ajp staff 1.3M Nov 11 10:41 hudson_model_DirectlyModifiableViewTest_doAddNestedJobToRecursiveView.appmap.json
|
|
185
|
-
4104 -rw-r--r-- 1 ajp staff 1.8M Nov 11 10:41 hudson_model_DirectlyModifiableViewTest_failWebMethodForIllegalRequest.appmap.json
|
|
186
|
-
```
|