feat: Add connection/worker tracking and standardize metric tags#15
Merged
feat: Add connection/worker tracking and standardize metric tags#15
Conversation
…f hardcoded values CRITICAL FIX: Plugins were using hardcoded metric IDs (1, 7) which may not exist in the database, causing silent failures in result storage. Changes: - Both bulk-load and tpcc-scalability plugins now properly look up metric IDs from database using GetMetric() instead of hardcoded values - Added comprehensive debug logging to trace data flow - Enhanced error handling in StoreResults with detailed logging - Added validation that results are actually being stored This ensures that test metrics are properly persisted to the database instead of silently failing due to invalid metric references.
- Add backgroundMetricsSaver goroutine to both bulk-load and tpcc-scalability plugins - Metrics are now saved to database every second during test execution - Added comprehensive logging to track metrics collection and storage - Ensures real-time data persistence instead of only saving at test end - Thread-safe implementation with proper context cancellation
- Add migration 004 to include active_connections and active_workers columns in test_run_result table - Update TestResult struct to include optional ActiveConnections and ActiveWorkers fields - Enhance StorageManager to handle new connection/worker fields in StoreResults and GetResults - Standardize tag structure across both plugins for consistent analysis: * All metrics now include: metric_type, iteration, connections, batch_size, total_transactions, total_rows, batch_count, test_phase * Use null values for non-applicable fields to maintain consistency * Add scale_factor for TPCC metrics and transaction_type for transaction counts - Update bulk-load plugin to track active connections and workers in all metrics - Update tpcc-scalability plugin with consistent tag structure and connection/worker tracking - Improve background metrics collection with real-time worker and connection statistics This ensures all metrics have consistent structure for easier analysis and querying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances the StormDB plugin system with comprehensive connection/worker tracking and standardizes metric tag structures for consistent analysis.
Key Features
🔧 Database Schema Enhancement
active_connectionsandactive_workerscolumns totest_run_resulttable📊 Core System Updates
ActiveConnectionsandActiveWorkersfields🏷️ Standardized Tag Structure
Previously, metrics had inconsistent tag structures making analysis difficult. Now all metrics include:
metric_type: Type of measurement (e.g., 'cumulative_tps', 'avg_latency_ms')iteration: Background save iteration (null for final results)connections: Number of database connectionsbatch_size: Batch size (null for TPCC metrics)total_transactions: Total transaction counttotal_rows: Total rows processed (null for TPCC)batch_count: Number of batches (null for TPCC)test_phase: 'measurement' or 'final_results'TPCC-specific additions:
scale_factor: TPC-C scale factortransaction_type: Type of TPC-C transaction🔄 Enhanced Plugin Functionality
Bulk-Load Plugin
TPCC-Scalability Plugin
Impact
Before
After
Testing
Migration Required
After merging, run the new migration:
Resolves the metrics inconsistency issues and provides comprehensive connection/worker tracking for better performance analysis.