Skip to content

Commit 9de37e6

Browse files
authored
Merge pull request #51 from product-science/morgachev/cloud-cost-part-1
Morgachev/cloud cost part 1
2 parents 5c9f40f + 4e4b02d commit 9de37e6

File tree

6 files changed

+122
-2
lines changed

6 files changed

+122
-2
lines changed

buildtools/mkdocs-setup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
python3 -m pip install -r buildtools/requirements.txt
2-
python3 -m pip install -e ps-plugin
1+
pip install -r buildtools/requirements.txt
2+
pip install -e ps-plugin
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Integration of CodeTuner for Cloud
2+
3+
The following instructions describe the integration process for CodeTuner for Cloud with your backend application.
4+
5+
6+
## Architecture
7+
CodeTuner for Cloud is an agent that connects to your working application,
8+
providing low-overhead runtime instrumentation to track the cost of interactions with the server.
9+
The agent sends data to the Control Panel, which stores and processes the data.
10+
11+
The Control Panel, a part of CodeTuner, stores data from agents, processes it, and manages the agent's configuration.
12+
The data is available for analysis in the CodeTuner UI.
13+
14+
15+
!!! info
16+
By default, CodeTuner and the Control Panel are hosted on Product Science servers.
17+
If your company's security rules do not allow sending data outside of the private network,
18+
CodeTuner and the Control Panel are available for on-premises distribution.
19+
Please contact the Product Science Team for more details.
20+
21+
22+
## Running Your Application
23+
24+
Run your application as usual.
25+
The agent will be attached to the already running application.
26+
Make sure to save the process ID to attach the agent.
27+
28+
29+
30+
## Attach Agent to the app's process
31+
32+
The Product Science Team will provide you with the Control Panel URL and a security token for communication between the agent and the Control Panel.
33+
34+
When attaching the agent, you need to configure three parameters:
35+
36+
1. `PS_CONTROL_PANEL_URL` - - The URL for the Control Panel, provided by Product Science.
37+
38+
2. `PS_AGENT_APPLICATION_API_KEY` - The security token, provided by Product Science.
39+
40+
3. `PS_AGENT_APPLICATION_NAME` - The name of your application.
41+
42+
43+
Then, run the JAR file `code-tuner-agent.jar` with the following command:
44+
45+
```bash
46+
java -jar code-tuner-agent.jar \
47+
--pid <PROCESS_ID> \
48+
--control-panel-url <PS_CONTROL_PANEL_URL> \
49+
--token <PS_AGENT_APPLICATION_API_KEY> \
50+
--app-name <PS_AGENT_APPLICATION_NAME>
51+
52+
```
53+
54+
If you need to analyze several instances, the agent should be attached to all of them.
55+
The same URL, application name, and token can be used for each instance.
56+
57+
58+
## Configuration
59+
60+
All further CodeTuner configuration will be done automatically based on your application's static and dynamic analysis.
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Integration for JVM based app
2+
3+
The JVM Agent allows both dynamic attaching to an already running JVM application and
4+
starting the application with the Agent attached.
5+
6+
## Attaching the Agent to a Running JVM Application
7+
8+
Attaching the Agent is described on the [integration](/cloudcost/integration/integration.md) page.
9+
Run your application as usual, then attach the CodeTuner Agent using the following command:
10+
11+
```bash
12+
java -jar code-tuner-agent.jar \
13+
--pid <PROCESS_ID> \
14+
--control-panel-url <PS_CONTROL_PANEL_URL> \
15+
--token <PS_AGENT_APPLICATION_API_KEY> \
16+
--app-name <PS_AGENT_APPLICATION_NAME>
17+
```
18+
19+
## Running the Application with the Agent Attached
20+
21+
To attach the agent at startup, follow these steps:
22+
23+
#### 1. Set environment variables
24+
25+
1. `PS_CONTROL_PANEL_URL` - - The URL for the Control Panel, provided by Product Science.
26+
27+
2. `PS_AGENT_APPLICATION_API_KEY` - The security token, provided by Product Science.
28+
29+
3. `PS_AGENT_APPLICATION_NAME` - The name of your application.
30+
31+
#### 2. Modify command to run the app
32+
33+
Typically, you run the application with a command like this:
34+
35+
```bash
36+
java -jar myapp.jar
37+
```
38+
39+
To attach CodeTuner Agent command should be modified to:
40+
```bash
41+
java \
42+
-javaagent:code-tuner-agent.jar
43+
-jar myapp.jar
44+
```
45+
46+
If you need to analyze several instances, the agent should be attached to all of them.
47+
The same URL, application name, and token can be used for each instance.

docs/cloudcost/overview.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code Tuner for Cloud
2+
3+
DESCRIPTION

docs/cloudcost/usage.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Usage
2+
3+
## Detect expensive API
4+
5+
## Analyze as part of user session
6+
7+
## Analyze trace

mkdocs.yml

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ nav:
3030
- Overview: regression-analysis/overview.md
3131
- API: regression-analysis/api.md
3232
- cURL example: regression-analysis/example.md
33+
- Cloud Cost:
34+
- Integration: cloudcost/integration/integration.md
35+
- JVM Agent: cloudcost/integration/jvm-agent.md
3336

3437
# Visual
3538
theme:

0 commit comments

Comments
 (0)