flow-debugger 1.2.0 → 1.3.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/README.md +4 -3
- package/assets/flow_debugger_v1.2.0.png +0 -0
- package/dashboard/app.js +42 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# 🔍 flow-debugger
|
|
2
2
|
|
|
3
|
-
**Production-safe flow-level debugging SDK for Node.js.**
|
|
4
|
-
|
|
3
|
+
**Production-safe flow-level debugging SDK for Node.js, Web, and React Native.**
|
|
4
|
+
|
|
5
|
+
Traces requests step-by-step, measures timing, classifies errors, detects root causes, and provides endpoint analytics with a live dashboard.
|
|
5
6
|
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-

|
|
9
10
|
|
|
10
11
|
## 🚀 Easy 3-Line Setup (Beginner Friendly)
|
|
11
12
|
Beginners can get a professional dashboard and request tracing with just **3 lines of code**:
|
|
Binary file
|
package/dashboard/app.js
CHANGED
|
@@ -35,7 +35,14 @@ async function refreshData() {
|
|
|
35
35
|
const res = await fetch(API_URL);
|
|
36
36
|
if (!res.ok) throw new Error('API error');
|
|
37
37
|
const data = await res.json();
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
// Seed sample data if empty for a better first-look experience
|
|
40
|
+
if (!data.totalRequests || data.totalRequests === 0) {
|
|
41
|
+
const seededData = seedSampleData(data);
|
|
42
|
+
renderDashboard(seededData);
|
|
43
|
+
} else {
|
|
44
|
+
renderDashboard(data);
|
|
45
|
+
}
|
|
39
46
|
} catch (err) {
|
|
40
47
|
document.getElementById('statusBadge').textContent = '● OFFLINE';
|
|
41
48
|
document.getElementById('statusBadge').className = 'badge badge-offline';
|
|
@@ -349,3 +356,37 @@ function formatDuration(ms) {
|
|
|
349
356
|
const hrs = Math.floor(mins / 60);
|
|
350
357
|
return hrs + 'h ' + (mins % 60) + 'm';
|
|
351
358
|
}
|
|
359
|
+
|
|
360
|
+
function seedSampleData(data) {
|
|
361
|
+
return {
|
|
362
|
+
...data,
|
|
363
|
+
uptime: 124000,
|
|
364
|
+
totalRequests: 1,
|
|
365
|
+
totalErrors: 0,
|
|
366
|
+
totalSlow: 0,
|
|
367
|
+
serviceHealth: [
|
|
368
|
+
{ name: 'mongo', status: 'healthy', successRate: 100, totalChecks: 12 },
|
|
369
|
+
{ name: 'redis', status: 'degraded', successRate: 92, totalChecks: 45 },
|
|
370
|
+
{ name: 'postgres', status: 'healthy', successRate: 100, totalChecks: 5 }
|
|
371
|
+
],
|
|
372
|
+
endpoints: [
|
|
373
|
+
{ method: 'GET', path: '/api/users', totalRequests: 1, errorCount: 0, slowCount: 0, avgDuration: 42, p95Duration: 42, maxDuration: 42, commonIssues: [] }
|
|
374
|
+
],
|
|
375
|
+
recentTraces: [
|
|
376
|
+
{
|
|
377
|
+
traceId: 'sample_trace_123',
|
|
378
|
+
endpoint: '/api/users',
|
|
379
|
+
method: 'GET',
|
|
380
|
+
totalDuration: 156,
|
|
381
|
+
classification: 'INFO',
|
|
382
|
+
language: 'node',
|
|
383
|
+
steps: [
|
|
384
|
+
{ name: 'Auth Check', service: 'internal', status: 'success', classification: 'INFO', startTime: 2, endTime: 12, duration: 10, offset: 2 },
|
|
385
|
+
{ name: 'DB Find User', service: 'mongo', status: 'success', classification: 'INFO', startTime: 15, endTime: 145, duration: 130, offset: 15 },
|
|
386
|
+
{ name: 'Redis Cache', service: 'redis', status: 'success', classification: 'INFO', startTime: 148, endTime: 155, duration: 7, offset: 148 }
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
]
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flow-debugger",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Production-safe flow-level debugging SDK. Traces requests, measures timing, classifies errors, detects root causes, and provides endpoint analytics with a live dashboard.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
],
|
|
65
65
|
"repository": {
|
|
66
66
|
"type": "git",
|
|
67
|
-
"url": "https://github.com/sannuk79/
|
|
67
|
+
"url": "https://github.com/sannuk79/PROJECTS-AND-NPM-PACKAGES-"
|
|
68
68
|
},
|
|
69
|
-
"homepage": "https://github.com/sannuk79/
|
|
69
|
+
"homepage": "https://github.com/sannuk79/PROJECTS-AND-NPM-PACKAGES-",
|
|
70
70
|
"bugs": {
|
|
71
71
|
"url": "https://github.com/sannuk79/debugerpackages/issues"
|
|
72
72
|
},
|