Spaces:
Runtime error
Runtime error
Download common/performance_config.go from Tomsass1/test-docker: direct link, hf CLI and curl.
- Browser
- Download file 808 Bytes
-
https://huggingface.co/spaces/Tomsass1/test-docker/resolve/main/common/performance_config.go
- Command line
-
hf download hf://spaces/Tomsass1/test-docker/common/performance_config.go
-
curl -L -o performance_config.go https://huggingface.co/spaces/Tomsass1/test-docker/resolve/main/common/performance_config.go
808 Bytes
| package common | |
| import "sync/atomic" | |
| // PerformanceMonitorConfig 性能监控配置 | |
| type PerformanceMonitorConfig struct { | |
| Enabled bool | |
| CPUThreshold int | |
| MemoryThreshold int | |
| DiskThreshold int | |
| } | |
| var performanceMonitorConfig atomic.Value | |
| func init() { | |
| // 初始化默认配置 | |
| performanceMonitorConfig.Store(PerformanceMonitorConfig{ | |
| Enabled: true, | |
| CPUThreshold: 90, | |
| MemoryThreshold: 90, | |
| DiskThreshold: 90, | |
| }) | |
| } | |
| // GetPerformanceMonitorConfig 获取性能监控配置 | |
| func GetPerformanceMonitorConfig() PerformanceMonitorConfig { | |
| return performanceMonitorConfig.Load().(PerformanceMonitorConfig) | |
| } | |
| // SetPerformanceMonitorConfig 设置性能监控配置 | |
| func SetPerformanceMonitorConfig(config PerformanceMonitorConfig) { | |
| performanceMonitorConfig.Store(config) | |
| } | |