Skip to content

Commit 91958ee

Browse files
committed
fixes and additions
1 parent 8c6c0bf commit 91958ee

File tree

15 files changed

+841
-442
lines changed

15 files changed

+841
-442
lines changed

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ A high-performance CLI tool for archiving PostgreSQL partitioned table data to S
1919

2020
- 🚀 **Parallel Processing** - Archive multiple partitions concurrently with configurable workers
2121
- 📊 **Beautiful Progress UI** - Real-time progress tracking with dual progress bars
22-
- 🌐 **Embedded Cache Viewer** - Beautiful web interface for monitoring cache and progress:
23-
- Real-time task monitoring with progress bar
22+
- 🌐 **Embedded Cache Viewer** - Beautiful web interface with real-time updates:
23+
- **WebSocket Live Updates** - Real-time data streaming without polling
24+
- Interactive task monitoring showing current partition and operation
25+
- Clickable partition names to jump directly to table row
2426
- Shows archiver status (running/idle) with PID tracking
2527
- Live statistics: total partitions, sizes, compression ratios
2628
- Sortable table with S3 upload status indicators
2729
- Smooth animations highlight data changes
2830
- Error tracking with timestamps
29-
- Customizable refresh rate (1s to 60s)
31+
- Auto-reconnecting WebSocket for reliability
3032
- 💾 **Intelligent Caching** - Advanced caching system for maximum efficiency:
3133
- Caches row counts for 24 hours (refreshed daily)
3234
- Caches file metadata permanently (size, MD5, compression ratio)
@@ -229,7 +231,12 @@ postgresql-archiver cache-viewer --port 8080
229231
```
230232

231233
Features:
232-
- **Real-time Updates**: Auto-refresh with customizable intervals (1s to 60s)
234+
- **WebSocket Real-time Updates**: Live data streaming with automatic reconnection
235+
- **Interactive Status Panel**:
236+
- Shows current partition being processed with clickable link
237+
- Displays specific operation (e.g., "Checking if exists", "Extracting", "Compressing", "Uploading")
238+
- Progress bar with completion percentage and partition count
239+
- Elapsed time tracking
233240
- **Visual Change Detection**: Smooth animations highlight updated cells and stats
234241
- **S3 Upload Status**: Shows which files are uploaded vs only processed locally
235242
- **Comprehensive Metrics**: Shows both compressed and uncompressed sizes
@@ -239,10 +246,19 @@ Features:
239246
- **Sortable Columns**: Click any column header to sort (default: partition name)
240247
- **File Counts**: Shows total partitions, processed, uploaded, and errors
241248
- **Process Monitoring**: Checks if archiver is currently running via PID
242-
- **Task Progress**: Displays current archiving task and progress when active
249+
- **Connection Status**: Visual indicator shows WebSocket connection state
243250

244251
Access the viewer at `http://localhost:8080` (or your configured port).
245252

253+
#### Technical Details
254+
255+
The cache viewer uses modern web technologies for optimal performance:
256+
- **WebSocket Protocol**: Bi-directional communication for instant updates
257+
- **Automatic Reconnection**: Reconnects every 2 seconds if connection drops
258+
- **File System Monitoring**: Watches cache directory for changes (500ms intervals)
259+
- **Efficient Updates**: Only transmits and renders changed data
260+
- **No Polling Overhead**: WebSocket eliminates the need for HTTP polling
261+
246262
### Interactive Progress Display
247263

248264
The tool features a beautiful terminal UI with:
@@ -367,9 +383,13 @@ The archiver provides real-time monitoring capabilities:
367383
- Updated in real-time during processing
368384

369385
### Web API Endpoints
370-
The cache viewer provides REST API endpoints:
371-
- `/api/cache` - Returns all cached metadata
372-
- `/api/status` - Returns archiver running status and current task
386+
The cache viewer provides REST API and WebSocket endpoints:
387+
- `/api/cache` - Returns all cached metadata (REST)
388+
- `/api/status` - Returns archiver running status and current task (REST)
389+
- `/ws` - WebSocket endpoint for real-time updates
390+
- Sends cache updates when files change
391+
- Streams status updates during archiving
392+
- Automatic reconnection support
373393

374394
## 🔐 Data Integrity Verification
375395

@@ -553,4 +573,5 @@ Built with these awesome libraries:
553573
- [Cobra](https://github.com/spf13/cobra) - CLI framework
554574
- [Viper](https://github.com/spf13/viper) - Configuration management
555575
- [klauspost/compress](https://github.com/klauspost/compress) - Fast zstd compression
556-
- [AWS SDK for Go](https://github.com/aws/aws-sdk-go) - S3 integration
576+
- [AWS SDK for Go](https://github.com/aws/aws-sdk-go) - S3 integration
577+
- [Gorilla WebSocket](https://github.com/gorilla/websocket) - WebSocket implementation

0 commit comments

Comments
 (0)