mirror of
https://github.com/woodchen-ink/proxy-go.git
synced 2025-07-18 16:41:54 +08:00
- Added new dependency on github.com/mattn/go-sqlite3 for improved metrics storage. - Updated main.go to initialize metrics collector with a new database path and configuration settings. - Enhanced config.json to include additional metrics settings such as alert configurations and latency thresholds. - Refactored internal metrics handling to support new metrics structures and improve data retrieval. - Introduced a new metrics history endpoint for retrieving historical data, enhancing monitoring capabilities. - Improved UI for metrics dashboard to include historical data visualization options.
24 lines
339 B
Go
24 lines
339 B
Go
package errors
|
|
|
|
type ErrorCode int
|
|
|
|
const (
|
|
ErrDatabase ErrorCode = iota + 1
|
|
ErrInvalidConfig
|
|
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
|
|
}
|