performance_setting

package
v0.10.9-alpha.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCacheStats

func GetCacheStats() common.DiskCacheStats

GetCacheStats 获取缓存统计信息(代理到 common 包)

func ResetStats

func ResetStats()

ResetStats 重置统计信息

func UpdateAndSync

func UpdateAndSync()

UpdateAndSync 更新配置并同步到 common 包 当配置从数据库加载后,需要调用此函数同步

Types

type PerformanceSetting

type PerformanceSetting struct {
	// DiskCacheEnabled 是否启用磁盘缓存(磁盘换内存)
	DiskCacheEnabled bool `json:"disk_cache_enabled"`
	// DiskCacheThresholdMB 触发磁盘缓存的请求体大小阈值(MB)
	DiskCacheThresholdMB int `json:"disk_cache_threshold_mb"`
	// DiskCacheMaxSizeMB 磁盘缓存最大总大小(MB)
	DiskCacheMaxSizeMB int `json:"disk_cache_max_size_mb"`
	// DiskCachePath 磁盘缓存目录
	DiskCachePath string `json:"disk_cache_path"`

	// MonitorEnabled 是否启用性能监控
	MonitorEnabled bool `json:"monitor_enabled"`
	// MonitorCPUThreshold CPU 使用率阈值(%)
	MonitorCPUThreshold int `json:"monitor_cpu_threshold"`
	// MonitorMemoryThreshold 内存使用率阈值(%)
	MonitorMemoryThreshold int `json:"monitor_memory_threshold"`
	// MonitorDiskThreshold 磁盘使用率阈值(%)
	MonitorDiskThreshold int `json:"monitor_disk_threshold"`
}

PerformanceSetting 性能设置配置

func GetPerformanceSetting

func GetPerformanceSetting() *PerformanceSetting

GetPerformanceSetting 获取性能设置

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL