mirror of
https://github.com/woodchen-ink/proxy-go.git
synced 2025-07-18 16:41:54 +08:00
- Added new performance monitoring settings in the configuration, including maximum requests per minute and data transfer limits. - Introduced validation parameters for metrics, ensuring data integrity and consistency checks during collection. - Refactored the metrics collector to streamline initialization and improve error handling. - Removed deprecated database-related code and optimized metrics saving processes. - Enhanced historical data management with regular clean-up routines to maintain performance. These changes improve the configurability and reliability of the metrics system, ensuring accurate data handling and enhanced monitoring capabilities.
23 lines
326 B
Go
23 lines
326 B
Go
package errors
|
|
|
|
type ErrorCode int
|
|
|
|
const (
|
|
ErrInvalidConfig ErrorCode = iota + 1
|
|
ErrRateLimit
|
|
ErrMetricsCollection
|
|
)
|
|
|
|
type MetricsError struct {
|
|
Code ErrorCode
|
|
Message string
|
|
Err error
|
|
}
|
|
|
|
func (e *MetricsError) Error() string {
|
|
if e.Err != nil {
|
|
return e.Message + ": " + e.Err.Error()
|
|
}
|
|
return e.Message
|
|
}
|