simple_apm 1.0.14 → 1.1.1
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.
- checksums.yaml +5 -5
- data/README.md +39 -31
- data/Rakefile +0 -5
- data/app/assets/stylesheets/simple_apm/application.css +611 -1
- data/app/controllers/simple_apm/apm_controller.rb +12 -6
- data/app/controllers/simple_apm/application_controller.rb +15 -1
- data/app/models/simple_apm/action.rb +20 -1
- data/app/models/simple_apm/request.rb +1 -0
- data/app/views/layouts/simple_apm/application.html.erb +57 -65
- data/app/views/simple_apm/apm/action_info.html.erb +72 -47
- data/app/views/simple_apm/apm/actions.html.erb +49 -26
- data/app/views/simple_apm/apm/dashboard.html.erb +100 -14
- data/app/views/simple_apm/apm/data.html.erb +69 -32
- data/app/views/simple_apm/apm/index.html.erb +35 -21
- data/app/views/simple_apm/apm/show.html.erb +132 -82
- data/config/locales/simple_apm.en.yml +131 -0
- data/config/locales/simple_apm.zh-CN.yml +131 -0
- data/config/routes.rb +1 -0
- data/lib/simple_apm/redis.rb +2 -2
- data/lib/simple_apm/setting.rb +11 -1
- data/lib/simple_apm/version.rb +1 -1
- data/lib/simple_apm/worker.rb +3 -1
- data/lib/simple_apm.rb +12 -9
- metadata +39 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: ac42ca5ebe7f45973a953586a00e22bb887d77da218f11ddf734dfb90975cbf8
|
|
4
|
+
data.tar.gz: d6ae570304dd85c0cb7bbc726fb42435f7a2d0ec461d6f2f3e56796bfed68353
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83534ce017f1502595622764a2768be13d26f47d271e00dbd5b39d44d3870031862d9e936a1d1c7bd4ec29c52ddf99088c8f42b7f866edc135d9975f4d9a86fb
|
|
7
|
+
data.tar.gz: b1ed3284d308e6f6c7694899887dc5734e0f7dbf38252374a509c2fc6d8990c6e20d7a3078c6c8d0e2836735e3e7a662d74a8e10335d859fd02e024d13623295
|
data/README.md
CHANGED
|
@@ -1,73 +1,81 @@
|
|
|
1
1
|
# SimpleApm (Rails Engine)
|
|
2
|
-
基于Redis的简单的Web请求性能监控/慢事务追踪工具
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
- 最慢的500个(默认500)请求
|
|
6
|
-
- 记录每个action最慢的20次请求
|
|
7
|
-
- 记录每个action的平均访问时间
|
|
8
|
-
- 记录慢请求的详情和对应SQL详情(多余的会删掉)
|
|
9
|
-
- 以10分钟为刻度记录平均/最慢访问时间、次数等性能指标,并生成图表
|
|
10
|
-
- 记录请求中外部http访问时间
|
|
3
|
+
A lightweight Redis-backed Rails engine for web request performance monitoring and slow request tracing.
|
|
11
4
|
|
|
5
|
+
SimpleApm records request performance by day:
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
- The slowest requests, 500 by default.
|
|
8
|
+
- The slowest 20 requests for each action.
|
|
9
|
+
- Average response time for each action.
|
|
10
|
+
- Slow request details and related SQL details, trimming excess records.
|
|
11
|
+
- Average and slowest response time, request count, and other metrics in 10-minute intervals, with charts.
|
|
12
|
+
- External HTTP request duration during each request.
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
The web UI supports English and Chinese. English is used by default, and users can switch languages from the top-right corner.
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
## How It Works
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
SimpleApm records request-level data around Rack and uses Redis for storage and aggregation.
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
The core data flow is based on [Active Support Instrumentation](https://guides.rubyonrails.org/active_support_instrumentation.html).
|
|
22
21
|
|
|
22
|
+
Instrumentation events are processed by a long-running worker thread so request handling does not block on metric aggregation.
|
|
23
|
+
|
|
24
|
+
Memory usage is collected with [get_process_mem](https://github.com/schneems/get_process_mem). In Linux testing, collection takes less than 1 ms.
|
|
25
|
+
|
|
26
|
+
## Screenshots
|
|
23
27
|
|
|
24
|
-
## 功能截图
|
|
25
28
|
- Dashboard
|
|
26
|
-

|
|
27
30
|
|
|
28
|
-
-
|
|
31
|
+
- Slow Requests
|
|
29
32
|

|
|
30
33
|
|
|
31
|
-
- Action
|
|
34
|
+
- Action List
|
|
32
35
|

|
|
33
36
|
|
|
34
|
-
-
|
|
37
|
+
- Request Info
|
|
35
38
|

|
|
36
39
|
|
|
37
|
-
- Action
|
|
38
|
-

|
|
40
|
+
- Action Info
|
|
41
|
+

|
|
42
42
|
|
|
43
|
+
- Data Management
|
|
44
|
+

|
|
43
45
|
|
|
44
46
|
## Usage
|
|
45
47
|
|
|
48
|
+
Mount the engine in your Rails routes:
|
|
49
|
+
|
|
46
50
|
```ruby
|
|
47
51
|
# routes.rb
|
|
48
52
|
mount SimpleApm::Engine => "/apm"
|
|
53
|
+
```
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
rails generate simple_apm:install
|
|
55
|
+
Or run the installer:
|
|
52
56
|
|
|
57
|
+
```bash
|
|
58
|
+
rails generate simple_apm:install
|
|
53
59
|
```
|
|
54
60
|
|
|
55
|
-
|
|
56
61
|
## Installation
|
|
62
|
+
|
|
57
63
|
Add this line to your application's Gemfile:
|
|
58
64
|
|
|
59
65
|
```ruby
|
|
60
|
-
gem
|
|
66
|
+
gem "simple_apm"
|
|
61
67
|
```
|
|
62
68
|
|
|
63
|
-
|
|
69
|
+
Then run:
|
|
70
|
+
|
|
64
71
|
```bash
|
|
65
|
-
|
|
72
|
+
bundle
|
|
66
73
|
```
|
|
67
74
|
|
|
68
|
-
|
|
69
75
|
## Contributing
|
|
70
|
-
|
|
76
|
+
|
|
77
|
+
Issues and pull requests are welcome.
|
|
71
78
|
|
|
72
79
|
## License
|
|
80
|
+
|
|
73
81
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|