nestjs-profiler 1.0.22 → 1.0.25

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.
Files changed (36) hide show
  1. package/README.md +160 -47
  2. package/collectors/http-collector.d.ts +12 -0
  3. package/collectors/http-collector.js +132 -0
  4. package/collectors/http-collector.js.map +1 -0
  5. package/collectors/log-collector.d.ts +3 -1
  6. package/collectors/log-collector.js +33 -12
  7. package/collectors/log-collector.js.map +1 -1
  8. package/common/profiler-options.interface.d.ts +1 -0
  9. package/common/profiler.model.d.ts +14 -0
  10. package/controllers/profiler.controller.d.ts +14 -1
  11. package/controllers/profiler.controller.js +148 -2
  12. package/controllers/profiler.controller.js.map +1 -1
  13. package/package.json +2 -2
  14. package/profiler.module.js +6 -0
  15. package/profiler.module.js.map +1 -1
  16. package/services/code-quality.service.d.ts +65 -0
  17. package/services/code-quality.service.js +216 -0
  18. package/services/code-quality.service.js.map +1 -0
  19. package/services/health.service.d.ts +59 -0
  20. package/services/health.service.js +175 -0
  21. package/services/health.service.js.map +1 -0
  22. package/services/profiler.service.d.ts +43 -1
  23. package/services/profiler.service.js +120 -0
  24. package/services/profiler.service.js.map +1 -1
  25. package/services/template-builder.service.d.ts +7 -0
  26. package/services/template-builder.service.js +278 -1
  27. package/services/template-builder.service.js.map +1 -1
  28. package/services/view.service.js +24 -12
  29. package/services/view.service.js.map +1 -1
  30. package/views/code-quality.html +573 -0
  31. package/views/dashboard.html +24 -0
  32. package/views/detail.html +2 -0
  33. package/views/health.html +468 -0
  34. package/views/layout.html +64 -1
  35. package/views/live-logs.html +324 -0
  36. package/views/summary.html +205 -0
package/README.md CHANGED
@@ -4,19 +4,29 @@
4
4
  <img src="https://raw.githubusercontent.com/MohammedRaslan/Nest-JS-Profiler/refs/heads/main/libs/nestjs-profiler/src/assets/logo.png" width="400" alt="NestJS Profiler Logo" />
5
5
  </p>
6
6
 
7
- A NestJS module for profiling HTTP requests, database queries, and cache operations. Inspired by Symfony Profiler, it provides a web-based dashboard to inspect request duration, executed queries, log messages, and explain plans for slow queries.
7
+ A NestJS module for profiling HTTP requests, database queries, cache operations, outbound HTTP calls, application logs, package health, and code quality. Inspired by Symfony Profiler, it provides a web-based dashboard to inspect everything that happens inside a request from DB queries to downstream API calls in real time.
8
8
 
9
9
  ## Features
10
10
 
11
- - **HTTP Request Tracing**: Tracks method, URL, controller handler, duration, and status code.
12
- - **Database Profiling**:
13
- - **PostgreSQL**: Captures queries executed via `pg` (compatible with TypeORM, MikroORM, raw pg). Supports **Auto-Explain** to running `EXPLAIN` or `EXPLAIN ANALYZE` on slow queries.
14
- - **MongoDB**: Profiles MongoDB commands and queries.
15
- - **MySQL**: Profiles MySQL queries.
16
- - **Cache Profiling**: Tracks cache operations (get, set, del) when using `@nestjs/cache-manager`.
17
- - **Logger Profiling**: Captures application logs associated with the request context.
18
- - **Web UI**: Built-in lightweight dashboard at `/__profiler` to view traces.
19
- - **Zero Hard Dependencies**: Core functionality works out of the box; database drivers are optional peer dependencies.
11
+ - **HTTP Request Tracing** Tracks method, URL, controller handler, duration, status code, headers, and request body.
12
+ - **Database Profiling**
13
+ - **PostgreSQL** Captures all queries via `pg` (compatible with TypeORM, MikroORM, raw pg). Supports **Auto-Explain** to run `EXPLAIN` or `EXPLAIN ANALYZE` on slow queries automatically.
14
+ - **MongoDB** Profiles MongoDB commands and queries.
15
+ - **MySQL** Profiles MySQL queries.
16
+ - **N+1 Detection** Automatically flags repeated identical queries within the same request.
17
+ - **Slow Query Tagging** Tags queries exceeding 100ms.
18
+ - **Sequential Scan Detection** Tags queries using a Seq Scan from the explain plan.
19
+ - **Outbound HTTP Tracking** Captures every outbound `http`/`https` call made during a request: URL, method, status code, duration, and headers. Works automatically with axios, node-fetch, and any library built on Node's `http`/`https` modules. Enabled by default — no configuration required.
20
+ - **Cache Profiling** — Tracks cache operations (get, set, del, reset) and hit/miss ratio when using `@nestjs/cache-manager`.
21
+ - **Log Profiling** — Captures application logs associated with each request context.
22
+ - **Live Logs Terminal** — Real-time streaming log viewer at `/__profiler/view/logs/live` via Server-Sent Events. Supports level filtering, search, pause/resume, and auto-scroll.
23
+ - **Summary Dashboard** — Aggregate statistics: avg/p95 duration, error rate, cache hit rate, top slow endpoints, top slow queries, and recent errors.
24
+ - **Entity Explorer** — Lists all registered TypeORM/MikroORM entities and their columns.
25
+ - **Route Explorer** — Lists all registered routes with their controllers and handlers.
26
+ - **Package Health** — Runs `npm audit` and `npm outdated` to surface known vulnerabilities and stale dependencies. Results are cached for 5 minutes. Works with npm, yarn, and pnpm. If the registry is unreachable, outdated packages are still shown with an inline warning.
27
+ - **Code Quality** — Runs ESLint and TypeScript compiler checks (`tsc --noEmit`) against your source code. Issues are displayed grouped by file or by rule, with direct links to ESLint rule docs and TypeScript error references. Auto-fixable issues are flagged. File paths are copyable with one click.
28
+ - **Web UI** — Built-in dashboard at `/__profiler` with no external dependencies.
29
+ - **Zero Hard Dependencies** — Core functionality works out of the box; database drivers are optional peer dependencies.
20
30
 
21
31
  ## Installation
22
32
 
@@ -26,7 +36,7 @@ npm install nestjs-profiler
26
36
 
27
37
  ### Peer Dependencies (Optional)
28
38
 
29
- Install the dependencies relevant to your project:
39
+ Install only the dependencies relevant to your project:
30
40
 
31
41
  ```bash
32
42
  # For PostgreSQL
@@ -44,48 +54,54 @@ npm install @nestjs/cache-manager cache-manager
44
54
 
45
55
  ## Configuration
46
56
 
47
- Import `ProfilerModule` in your root `AppModule`.
57
+ Import `ProfilerModule` in your root `AppModule`:
48
58
 
49
59
  ```typescript
50
60
  import { Module } from '@nestjs/common';
51
61
  import { ProfilerModule } from 'nestjs-profiler';
62
+ import * as pg from 'pg';
52
63
 
53
64
  @Module({
54
65
  imports: [
55
66
  ProfilerModule.forRoot({
56
67
  // Global enable/disable (default: true)
68
+ // Recommended: disable in production
57
69
  enabled: process.env.NODE_ENV !== 'production',
58
70
 
59
- // PostgreSQL Profiling
71
+ // ── Database ─────────────────────────────────────────────────
72
+ // PostgreSQL — pass the pg driver instance
73
+ pgDriver: pg,
60
74
  collectQueries: true,
75
+
76
+ // Auto-Explain for slow queries
61
77
  explain: {
62
78
  enabled: true,
63
- thresholdMs: 50, // Only explain queries taking > 50ms
64
- analyze: false, // If true, runs EXPLAIN ANALYZE (execution!)
79
+ thresholdMs: 50, // Only explain queries taking > 50ms
80
+ analyze: false, // true = EXPLAIN ANALYZE (actually executes!)
65
81
  },
66
- // Add pgDriver
67
- pgDriver: pg,
68
82
 
69
- // Add mysql2 driver for MySQL profiling
70
- mysqlDriver: mysql2,
71
-
72
- // Add mongodb driver for MongoDB profiling
73
- mongoDriver: mongodb,
74
-
75
- // MongoDB Profiling (default: true)
83
+ // MongoDB pass the mongodb driver instance
84
+ mongoDriver: require('mongodb'),
76
85
  collectMongo: true,
77
86
 
78
- // MySQL Profiling (default: true)
87
+ // MySQL pass the mysql2 driver instance
88
+ mysqlDriver: require('mysql2'),
79
89
  collectMysql: true,
80
90
 
81
- // Cache Profiling (default: true)
82
- collectCache: true,
91
+ // ── Outbound HTTP ─────────────────────────────────────────────
92
+ // Tracks all outbound http/https calls made during each request.
93
+ // Enabled by default — set false to disable.
94
+ collectHttp: true,
95
+
96
+ // ── Cache ─────────────────────────────────────────────────────
97
+ collectCache: true, // requires @nestjs/cache-manager
83
98
 
84
- // Log Profiling (default: true)
99
+ // ── Logs ──────────────────────────────────────────────────────
85
100
  collectLogs: true,
86
101
 
87
- // Storage backend (default: InMemory)
88
- // You can implement custom storage by passing an object implementing ProfilerStorage
102
+ // ── Storage ───────────────────────────────────────────────────
103
+ // Default: in-memory (last 100 requests).
104
+ // Pass a custom object implementing ProfilerStorage for persistence.
89
105
  storage: 'memory',
90
106
  }),
91
107
  ],
@@ -93,14 +109,24 @@ import { ProfilerModule } from 'nestjs-profiler';
93
109
  export class AppModule {}
94
110
  ```
95
111
 
112
+ ### Default behaviour
113
+
114
+ | Option | Default | Notes |
115
+ |---|---|---|
116
+ | `enabled` | `true` | Set `false` or tie to `NODE_ENV` |
117
+ | `collectHttp` | `true` | Patches `http`/`https` automatically |
118
+ | `collectLogs` | `true` | |
119
+ | `collectQueries` | `true` | Requires `pgDriver` / `mongoDriver` / `mysqlDriver` |
120
+ | `collectCache` | `true` | Requires `@nestjs/cache-manager` |
121
+ | `explain.enabled` | `false` | Opt-in only |
122
+
96
123
  ## Usage
97
124
 
98
125
  ### 1. Initialize Explorers (Optional but Recommended)
99
126
 
100
- To enable the **Entity Explorer** and **Route Explorer** features in the dashboard, initialize the profiler in your `main.ts` file right after creating the application.
127
+ To enable the **Entity Explorer** and **Route Explorer**, call `initialize` in `main.ts` after creating the app:
101
128
 
102
129
  ```typescript
103
- // main.ts
104
130
  import { NestFactory } from '@nestjs/core';
105
131
  import { AppModule } from './app.module';
106
132
  import { ProfilerModule } from 'nestjs-profiler';
@@ -108,7 +134,6 @@ import { ProfilerModule } from 'nestjs-profiler';
108
134
  async function bootstrap() {
109
135
  const app = await NestFactory.create(AppModule);
110
136
 
111
- // Initialize Profiler Explorers
112
137
  ProfilerModule.initialize(app);
113
138
 
114
139
  await app.listen(3000);
@@ -118,26 +143,114 @@ bootstrap();
118
143
 
119
144
  ### 2. Accessing the Dashboard
120
145
 
121
- Once configured, start your application. The profiler automatically intercepts requests and queries.
146
+ Once configured, start your application. The profiler automatically intercepts all requests.
147
+
148
+ Navigate to `http://localhost:3000/__profiler`.
149
+
150
+ #### Dashboard Pages
151
+
152
+ | Path | Description |
153
+ |---|---|
154
+ | `/__profiler` | Redirects to Summary (default landing page) |
155
+ | `/__profiler/view/summary` | Aggregate stats: avg/p95 duration, error rate, top slow endpoints |
156
+ | `/__profiler/view/requests` | All captured requests |
157
+ | `/__profiler/view/queries` | All database queries across requests, sorted by duration |
158
+ | `/__profiler/view/http-calls` | All outbound HTTP calls across requests, sorted by duration |
159
+ | `/__profiler/view/logs` | Paginated application logs |
160
+ | `/__profiler/view/logs/live` | Live streaming terminal — real-time log output |
161
+ | `/__profiler/view/cache` | Cache operations with hit/miss breakdown |
162
+ | `/__profiler/view/entities` | Registered database entities |
163
+ | `/__profiler/view/routes` | All registered application routes |
164
+ | `/__profiler/view/health` | Package vulnerabilities and outdated dependency report |
165
+ | `/__profiler/view/code-quality` | ESLint and TypeScript static analysis report |
166
+ | `/__profiler/:id` | Full detail view for a single request |
167
+
168
+ ### 3. Outbound HTTP Tracking
169
+
170
+ Outbound HTTP tracking is **enabled by default**. Any `http.request`, `https.request`, `http.get`, or `https.get` call made during a request is automatically captured — including calls made via axios, node-fetch, and similar libraries.
171
+
172
+ Each captured call records:
173
+
174
+ - Method and full URL
175
+ - HTTP vs HTTPS protocol
176
+ - Response status code
177
+ - Duration in ms
178
+ - Request and response headers (Authorization/Cookie values are automatically redacted)
179
+ - Error message if the call failed
180
+
181
+ You can view outbound calls for a specific request in the request detail view, or browse all calls across all requests at `/__profiler/view/http-calls`.
182
+
183
+ To disable:
184
+
185
+ ```typescript
186
+ ProfilerModule.forRoot({ collectHttp: false })
187
+ ```
188
+
189
+ ### 4. Package Health
190
+
191
+ The Health tab runs `npm audit` and `npm outdated` from your project root and displays the results in a searchable UI.
122
192
 
123
- Navigate to `http://localhost:3000/__profiler` (or your app's port).
193
+ - **Vulnerabilities** sorted by severity (critical high → moderate → low), with fix availability and whether the package is a direct or transitive dependency.
194
+ - **Outdated packages** — shows current, wanted, and latest versions with major-update warnings.
195
+ - Results are **cached for 5 minutes** server-side. Navigating back to the tab shows the cached result instantly without re-running. Click **Re-run audit** to force a fresh scan.
196
+ - If `npm audit` cannot reach the registry (e.g. VPN or proxy), the outdated packages section still renders with an inline warning for the unavailable audit.
197
+ - No configuration required — works automatically for npm, yarn, and pnpm projects.
124
198
 
125
- ### 3. JSON API
199
+ #### JSON endpoint
126
200
 
127
- You can also retrieve profile data programmatically:
201
+ ```
202
+ GET /__profiler/api/health # cached result (5 min TTL)
203
+ GET /__profiler/api/health?force=true # force fresh scan
204
+ ```
205
+
206
+ ### 5. Code Quality
207
+
208
+ The Code Quality tab runs static analysis tools against your source code and surfaces every issue without AI or external services.
209
+
210
+ **ESLint** — uses your project's existing ESLint configuration (`node_modules/.bin/eslint`). Results are shown in two views:
211
+
212
+ - **By File** — expandable accordion rows per file. Each issue shows line:column, severity badge, message, fix indicator (⚡ auto-fixable), and a clickable rule badge linking to the ESLint documentation.
213
+ - **By Rule** — sorted by severity then count, showing how many files are affected per rule.
214
+
215
+ **TypeScript** — runs `tsc --noEmit` using your project's `tsconfig.json`. Each error links to `typescript.tv/errors` for explanations.
216
+
217
+ **Summary cards** show total issues, errors, warnings, auto-fixable count, and files affected at a glance.
218
+
219
+ File paths have a **copy-to-clipboard** button that appears on hover, making it easy to jump to the file in your editor.
220
+
221
+ Results are cached for 5 minutes. Click **Re-run** to force a fresh analysis.
222
+
223
+ > **Note:** Code Quality only lints the `src/` directory (or project root if `src/` doesn't exist) and automatically ignores `dist/`, `build/`, `coverage/`, and other generated directories.
128
224
 
129
- - `GET /__profiler/json` - List recent requests
130
- - `GET /__profiler/:id/json` - Get details for a specific request
225
+ #### JSON endpoint
226
+
227
+ ```
228
+ GET /__profiler/api/code-quality # cached result (5 min TTL)
229
+ GET /__profiler/api/code-quality?force=true # force fresh scan
230
+ ```
231
+
232
+ ### 6. JSON API
233
+
234
+ Retrieve profile data programmatically:
235
+
236
+ - `GET /__profiler/json` — List all captured requests
237
+ - `GET /__profiler/:id/json` — Details for a specific request
238
+
239
+ ## Global Prefix
240
+
241
+ If your app uses a global prefix (e.g. `/api`), exclude the profiler routes:
242
+
243
+ ```typescript
244
+ app.setGlobalPrefix('api', {
245
+ exclude: [{ path: '__profiler/(.*)', method: RequestMethod.ALL }],
246
+ });
247
+ ```
131
248
 
132
- ### NOTE: IMPORTANT
249
+ ## Important Notes
133
250
 
134
- - The profiler is designed for development and debugging. **Do not enable in production** due to performance overhead and potential security risks.
135
- - If you have a prefix for your API routes (e.g., `/api`), you have to adjust the global prefix like this:
136
- ```typescript
137
- app.setGlobalPrefix('api', {
138
- exclude: [{ path: '__profiler/(.*)', method: RequestMethod.ALL }],
139
- });
140
- ```
251
+ - The profiler is designed for **development and debugging only**. Do not enable in production it adds request overhead and exposes internal application data.
252
+ - The default in-memory storage holds the last 100 requests. Older profiles are evicted automatically.
253
+ - Outbound HTTP tracking patches `http`/`https` at the Node.js module level. The patch is applied once on module init and is safe for hot-reload (double-patch is guarded).
141
254
 
142
255
  ## License
143
256
 
@@ -0,0 +1,12 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import type { ProfilerOptions } from '../common/profiler-options.interface';
3
+ import { ProfilerService } from '../services/profiler.service';
4
+ export declare class HttpCollector implements OnModuleInit {
5
+ private readonly profiler;
6
+ private readonly options;
7
+ private readonly logger;
8
+ constructor(profiler: ProfilerService, options: ProfilerOptions);
9
+ onModuleInit(): void;
10
+ private patchModule;
11
+ private sanitiseHeaders;
12
+ }
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var HttpCollector_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.HttpCollector = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ const profiler_service_1 = require("../services/profiler.service");
19
+ const PROFILER_INTERNAL_HEADER = 'x-profiler-internal';
20
+ let HttpCollector = HttpCollector_1 = class HttpCollector {
21
+ constructor(profiler, options) {
22
+ this.profiler = profiler;
23
+ this.options = options;
24
+ this.logger = new common_1.Logger(HttpCollector_1.name);
25
+ }
26
+ onModuleInit() {
27
+ if (this.options.collectHttp === false)
28
+ return;
29
+ const httpMod = require('http');
30
+ const httpsMod = require('https');
31
+ this.patchModule(httpMod, 'http');
32
+ this.patchModule(httpsMod, 'https');
33
+ this.logger.log('HTTP/HTTPS outbound request tracking enabled');
34
+ }
35
+ patchModule(mod, protocol) {
36
+ if (mod.__profilerPatched)
37
+ return;
38
+ mod.__profilerPatched = true;
39
+ const self = this;
40
+ const originalRequest = mod.request.bind(mod);
41
+ const originalGet = mod.get.bind(mod);
42
+ mod.request = function (...args) {
43
+ const startTime = Date.now();
44
+ let method = 'GET';
45
+ let host = '';
46
+ let path = '/';
47
+ let fullUrl = '';
48
+ let reqHeaders = {};
49
+ try {
50
+ const first = args[0];
51
+ if (typeof first === 'string' || first instanceof URL) {
52
+ const u = typeof first === 'string' ? new URL(first) : first;
53
+ host = u.hostname + (u.port ? `:${u.port}` : '');
54
+ path = u.pathname + u.search;
55
+ fullUrl = u.toString();
56
+ const opts = (args[1] && typeof args[1] === 'object' && typeof args[1] !== 'function') ? args[1] : {};
57
+ method = (opts?.method || 'GET').toUpperCase();
58
+ reqHeaders = opts?.headers || {};
59
+ }
60
+ else if (first && typeof first === 'object') {
61
+ method = (first.method || 'GET').toUpperCase();
62
+ host = first.hostname || first.host || 'localhost';
63
+ if (first.port && !String(host).includes(':'))
64
+ host += `:${first.port}`;
65
+ path = first.path || '/';
66
+ const defaultPort = protocol === 'https' ? 443 : 80;
67
+ const portStr = first.port && first.port !== defaultPort ? `:${first.port}` : '';
68
+ fullUrl = `${protocol}://${first.hostname || first.host || 'localhost'}${portStr}${path}`;
69
+ reqHeaders = first.headers || {};
70
+ }
71
+ }
72
+ catch (_) { }
73
+ if (reqHeaders[PROFILER_INTERNAL_HEADER] || fullUrl.includes('/__profiler')) {
74
+ return originalRequest(...args);
75
+ }
76
+ const profile = self.profiler.getCurrentProfile();
77
+ const req = originalRequest(...args);
78
+ if (profile) {
79
+ const httpCall = {
80
+ method,
81
+ url: fullUrl,
82
+ host,
83
+ path,
84
+ protocol,
85
+ startTime,
86
+ duration: 0,
87
+ requestHeaders: self.sanitiseHeaders(reqHeaders),
88
+ };
89
+ req.on('response', (res) => {
90
+ httpCall.statusCode = res.statusCode;
91
+ httpCall.responseHeaders = self.sanitiseHeaders(res.headers);
92
+ res.on('end', () => {
93
+ httpCall.duration = Date.now() - startTime;
94
+ self.profiler.addHttpCall(httpCall);
95
+ });
96
+ res.resume();
97
+ });
98
+ req.on('error', (err) => {
99
+ httpCall.duration = Date.now() - startTime;
100
+ httpCall.error = err.message;
101
+ self.profiler.addHttpCall(httpCall);
102
+ });
103
+ }
104
+ return req;
105
+ };
106
+ mod.get = function (...args) {
107
+ const req = mod.request(...args);
108
+ req.end();
109
+ return req;
110
+ };
111
+ }
112
+ sanitiseHeaders(headers) {
113
+ const result = {};
114
+ for (const [k, v] of Object.entries(headers || {})) {
115
+ const lower = k.toLowerCase();
116
+ if (lower === 'authorization' || lower === 'cookie' || lower === 'set-cookie') {
117
+ result[k] = '[redacted]';
118
+ }
119
+ else {
120
+ result[k] = Array.isArray(v) ? v.join(', ') : String(v ?? '');
121
+ }
122
+ }
123
+ return result;
124
+ }
125
+ };
126
+ exports.HttpCollector = HttpCollector;
127
+ exports.HttpCollector = HttpCollector = HttpCollector_1 = __decorate([
128
+ (0, common_1.Injectable)(),
129
+ __param(1, (0, common_1.Inject)('PROFILER_OPTIONS')),
130
+ __metadata("design:paramtypes", [profiler_service_1.ProfilerService, Object])
131
+ ], HttpCollector);
132
+ //# sourceMappingURL=http-collector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-collector.js","sourceRoot":"","sources":["../../../libs/nestjs-profiler/src/collectors/http-collector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;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MAAM,KAAK,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;YAC9B,IAAI,KAAK,KAAK,eAAe,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,YAAY,EAAE,CAAC;gBAC5E,MAAM,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACJ,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YAClE,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AAvHY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAMJ,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCADA,kCAAe;GAJrC,aAAa,CAuHzB"}
@@ -7,6 +7,8 @@ export declare class LogCollector implements OnModuleInit {
7
7
  private logger;
8
8
  constructor(profiler: ProfilerService, options: ProfilerOptions);
9
9
  onModuleInit(): void;
10
+ private stripAnsi;
11
+ private detectLevel;
12
+ private parseNestLog;
10
13
  private patchProcessStream;
11
- private capture;
12
14
  }
@@ -30,6 +30,29 @@ let LogCollector = LogCollector_1 = class LogCollector {
30
30
  this.patchProcessStream('stderr');
31
31
  this.logger.log('LogCollector initialized: Patching process.stdout/stderr');
32
32
  }
33
+ stripAnsi(str) {
34
+ return str.replace(/\x1b\[[0-9;]*m/g, '').replace(/\x1b\[[0-9;]*[A-Za-z]/g, '');
35
+ }
36
+ detectLevel(raw, fallback) {
37
+ if (raw.includes('\x1b[31m'))
38
+ return 'error';
39
+ if (raw.includes('\x1b[33m'))
40
+ return 'warn';
41
+ if (raw.includes('\x1b[95m'))
42
+ return 'debug';
43
+ if (raw.includes('\x1b[96m'))
44
+ return 'verbose';
45
+ if (raw.includes('\x1b[32m'))
46
+ return 'log';
47
+ return fallback;
48
+ }
49
+ parseNestLog(clean) {
50
+ const match = clean.match(/^\[Nest\]\s+\d+\s+-\s+[\d/,: APM]+\s+\w+\s+\[([^\]]+)\]\s+(.+)$/s);
51
+ if (match)
52
+ return { context: match[1], message: match[2].trim() };
53
+ const prefixStripped = clean.replace(/^\[Nest\]\s+\d+\s+-\s+[\d/,: APM]+\s+\w+\s+/, '').trim();
54
+ return { message: prefixStripped || clean };
55
+ }
33
56
  patchProcessStream(streamName) {
34
57
  const stream = process[streamName];
35
58
  const originalWrite = stream.write;
@@ -37,25 +60,23 @@ let LogCollector = LogCollector_1 = class LogCollector {
37
60
  stream.write = function (chunk, encodingOrCb, cb) {
38
61
  const result = originalWrite.apply(this, arguments);
39
62
  try {
40
- const msg = chunk.toString();
41
- if (msg.includes('[LogCollector]'))
63
+ const raw = chunk.toString();
64
+ if (raw.includes('[LogCollector]'))
65
+ return result;
66
+ const level = self.detectLevel(raw, streamName === 'stderr' ? 'error' : 'log');
67
+ const clean = self.stripAnsi(raw).trim();
68
+ if (!clean)
42
69
  return result;
43
- self.capture(streamName === 'stderr' ? 'error' : 'log', msg);
70
+ const { context, message } = self.parseNestLog(clean);
71
+ if (!message)
72
+ return result;
73
+ self.profiler.addLog({ level, message, context, timestamp: Date.now() });
44
74
  }
45
75
  catch (e) {
46
76
  }
47
77
  return result;
48
78
  };
49
79
  }
50
- capture(level, message) {
51
- if (!message.trim())
52
- return;
53
- this.profiler.addLog({
54
- level,
55
- message: message.trim(),
56
- timestamp: Date.now()
57
- });
58
- }
59
80
  };
60
81
  exports.LogCollector = LogCollector;
61
82
  exports.LogCollector = LogCollector = LogCollector_1 = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"log-collector.js","sourceRoot":"","sources":["../../../libs/nestjs-profiler/src/collectors/log-collector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyF;AACzF,mEAA+D;AAIxD,IAAM,YAAY,oBAAlB,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AM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBAC/E,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;gBACzC,IAAI,CAAC,KAAK;oBAAE,OAAO,MAAM,CAAC;gBAE1B,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBACtD,IAAI,CAAC,OAAO;oBAAE,OAAO,MAAM,CAAC;gBAE5B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC7E,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;YACb,CAAC;YAED,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC;IACN,CAAC;CACJ,CAAA;AAzEY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAMJ,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCADT,kCAAe;GAJ5B,YAAY,CAyExB"}
@@ -16,5 +16,6 @@ export interface ProfilerOptions {
16
16
  collectMongo?: boolean;
17
17
  collectCache?: boolean;
18
18
  collectMysql?: boolean;
19
+ collectHttp?: boolean;
19
20
  explain?: ProfilerExplainOptions;
20
21
  }
@@ -31,6 +31,19 @@ export interface CacheProfile {
31
31
  startTime: number;
32
32
  value?: any;
33
33
  }
34
+ export interface HttpCallProfile {
35
+ method: string;
36
+ url: string;
37
+ host: string;
38
+ path: string;
39
+ statusCode?: number;
40
+ duration: number;
41
+ startTime: number;
42
+ requestHeaders?: Record<string, string>;
43
+ responseHeaders?: Record<string, string>;
44
+ error?: string;
45
+ protocol: 'http' | 'https';
46
+ }
34
47
  export interface RequestProfile {
35
48
  id: string;
36
49
  method: string;
@@ -52,6 +65,7 @@ export interface RequestProfile {
52
65
  queries: QueryProfile[];
53
66
  logs: LogProfile[];
54
67
  cache?: CacheProfile[];
68
+ httpCalls?: HttpCallProfile[];
55
69
  timestamp: number;
56
70
  requestHeaders?: Record<string, any>;
57
71
  requestBody?: any;
@@ -4,14 +4,19 @@ import { ViewService } from '../services/view.service';
4
4
  import { TemplateBuilderService } from '../services/template-builder.service';
5
5
  import { EntityExplorerService } from '../services/entity-explorer.service';
6
6
  import { RouteExplorerService } from '../services/route-explorer.service';
7
+ import { HealthService } from '../services/health.service';
8
+ import { CodeQualityService } from '../services/code-quality.service';
7
9
  export declare class ProfilerController {
8
10
  private readonly profilerService;
9
11
  private readonly viewService;
10
12
  private readonly templateBuilder;
11
13
  private readonly entityExplorer;
12
14
  private readonly routeExplorer;
13
- constructor(profilerService: ProfilerService, viewService: ViewService, templateBuilder: TemplateBuilderService, entityExplorer: EntityExplorerService, routeExplorer: RouteExplorerService);
15
+ private readonly healthService;
16
+ private readonly codeQualityService;
17
+ constructor(profilerService: ProfilerService, viewService: ViewService, templateBuilder: TemplateBuilderService, entityExplorer: EntityExplorerService, routeExplorer: RouteExplorerService, healthService: HealthService, codeQualityService: CodeQualityService);
14
18
  dashboard(res: Response): Promise<void>;
19
+ requestsList(res: Response): Promise<void>;
15
20
  listJson(): Promise<import("..").RequestProfile[]>;
16
21
  debugQuery(): Promise<{
17
22
  status: string;
@@ -24,11 +29,19 @@ export declare class ProfilerController {
24
29
  }>;
25
30
  detail(id: string, res: Response): Promise<void>;
26
31
  detailJson(id: string): Promise<import("..").RequestProfile>;
32
+ summary(res: Response): Promise<void>;
27
33
  listQueries(res: Response): Promise<void>;
28
34
  listLogs(res: Response, page?: number): Promise<void>;
29
35
  listEntities(res: Response): Promise<void>;
30
36
  listRoutes(res: Response): Promise<void>;
31
37
  listCache(res: Response): Promise<void>;
38
+ listHttpCalls(res: Response): Promise<void>;
39
+ healthPage(res: Response): Promise<void>;
40
+ healthAudit(force?: string): Promise<import("../services/health.service").HealthReport>;
41
+ codeQualityPage(res: Response): Promise<void>;
42
+ codeQualityAudit(force?: string): Promise<import("../services/code-quality.service").CodeQualityReport>;
43
+ liveLogsPage(res: Response): Promise<void>;
44
+ liveLogsStream(res: Response): void;
32
45
  serveAsset(file: string, res: Response): Promise<void>;
33
46
  serveJs(file: string, res: Response): Promise<void>;
34
47
  }