lsq888lsq opened a new pull request, #12001:
URL: https://github.com/apache/inlong/pull/12001
#### Motivation
This component provides the core functionality for retrieving and processing
audit metric data from the database. It enables the system to query audit
records, aggregate data by InLong groups and streams, and support time-based
filtering for comprehensive audit analysis.
#### Modifications
**1. Data Query Service**
- Added `AuditMetricService` class with `getStorageAuditMetrics()` method
- Handles database queries for audit metrics within specified time ranges
- Returns aggregated data grouped by InLong group and stream
**2. Data Access Layer**
- Created `AuditMapper` interface with MyBatis annotations
- `getAuditMetrics()` method executes SQL queries with parameters:
- `audit_id`: Specific audit identifier
- `startLogTs`: Start timestamp for query range
- `endLogTs`: End timestamp for query range
**3. Database Connectivity**
- Implemented `AuditSQLUtil` utility class for database management:
- `initialize()`: Sets up connection pool and MyBatis configuration
- `getSqlSession()`: Provides database sessions for query execution
- Connection parameters configured via application properties
**4. Data Model**
- `AuditMetric` entity class maps query results with fields:
- `inlongGroupId`: Group identifier
- `inlongStreamId`: Stream identifier
- `count`: Aggregated metric count
#### Verification
- [ ] Requires unit tests for database query functionality
- [ ] Needs integration tests for actual database connectivity
- [ ] Should validate SQL query correctness and performance
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]