Commit 396fb81
Remove old middleware and consolidate to unified event-driven tracking
This commit completes the middleware consolidation by removing deprecated
components and switching to a unified event-driven architecture:
**Removed old middleware classes:**
- MCPMMonitoringMiddleware -> replaced by MCPMUnifiedTrackingMiddleware
- MCPMUsageTrackingMiddleware -> replaced by MCPMUnifiedTrackingMiddleware
**Removed deprecated database code:**
- usage_sessions table and all related queries
- track_session method from AccessMonitor interface
- session_tracker.py module and its exports
**Updated tracking approach:**
- All tracking now uses events (SESSION_START/SESSION_END) with session_id linking
- Usage statistics computed at query time from events table
- Simplified method delegation to computed stats
- Maintained backward compatibility for metadata formats
**Benefits:**
- Single unified middleware handles all tracking automatically
- Event-driven architecture enables rich analytics
- Simplified codebase with consistent patterns
- Better session correlation via session_id
All tests pass and usage command works correctly with computed statistics.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 19090fc commit 396fb81
File tree
13 files changed
+1387
-840
lines changed- src/mcpm
- commands
- profile
- fastmcp_integration
- monitor
- tests
13 files changed
+1387
-840
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 34 | | |
89 | 35 | | |
90 | 36 | | |
91 | 37 | | |
92 | 38 | | |
93 | 39 | | |
94 | 40 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 41 | + | |
99 | 42 | | |
100 | 43 | | |
| 44 | + | |
101 | 45 | | |
102 | 46 | | |
103 | 47 | | |
104 | 48 | | |
| 49 | + | |
105 | 50 | | |
106 | 51 | | |
107 | 52 | | |
| |||
216 | 161 | | |
217 | 162 | | |
218 | 163 | | |
219 | | - | |
220 | | - | |
| 164 | + | |
| 165 | + | |
221 | 166 | | |
222 | 167 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 85 | + | |
88 | 86 | | |
89 | 87 | | |
90 | 88 | | |
| |||
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
0 commit comments