Remove complete time series aggregation example and add data collection service implementation

- Deleted `example_complete_series_aggregation.py` as it is no longer needed.
- Introduced `data_collection_service.py`, a production-ready service for cryptocurrency market data collection with clean logging and robust error handling.
- Added configuration management for multiple trading pairs and exchanges, supporting health monitoring and graceful shutdown.
- Created `data_collection.json` for service configuration, including exchange settings and logging preferences.
- Updated `CandleProcessingConfig` to reflect changes in timeframes for candle processing.
- Enhanced documentation to cover the new data collection service and its configuration, ensuring clarity for users.
This commit is contained in:
Vasily.onl
2025-06-02 14:23:08 +08:00
parent 24b6a3feed
commit 1cca8cda16
9 changed files with 1161 additions and 244 deletions

View File

@@ -45,6 +45,11 @@ class BaseRepository:
if self.logger:
self.logger.info(message)
def log_debug(self, message: str) -> None:
"""Log debug message if logger is available."""
if self.logger:
self.logger.debug(message)
def log_error(self, message: str) -> None:
"""Log error message if logger is available."""
if self.logger:
@@ -133,7 +138,7 @@ class MarketDataRepository(BaseRepository):
session.commit()
self.log_info(f"{action} candle: {candle.symbol} {candle.timeframe} at {candle_timestamp} (force_update={force_update})")
self.log_debug(f"{action} candle: {candle.symbol} {candle.timeframe} at {candle_timestamp} (force_update={force_update})")
return True
except Exception as e:
@@ -294,7 +299,7 @@ class RawTradeRepository(BaseRepository):
session.commit()
self.log_info(f"Stored raw {data_point.data_type.value} data for {data_point.symbol}")
self.log_debug(f"Stored raw {data_point.data_type.value} data for {data_point.symbol}")
return True
except Exception as e:
@@ -343,7 +348,7 @@ class RawTradeRepository(BaseRepository):
session.commit()
self.log_info(f"Stored raw WebSocket data: {data_type} for {symbol}")
self.log_debug(f"Stored raw WebSocket data: {data_type} for {symbol}")
return True
except Exception as e: