xfy 2734b04d8f refactor: remove 16.8k lines of dead code across all internal packages
- Delete unused files: tempfile subsystem, matcher variants, server/internal
- Remove 200+ unused functions across proxy, ssl, lua, http2/3, stream, variable
- Fix proxy test type errors (backgroundRefresh ctx→Request)
- Move bench/tools mock backend into internal/testutil
- Remove corresponding test functions for all deleted code
2026-06-03 16:15:43 +08:00

38 lines
854 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package variable 提供 sync.Pool 用于复用 Context减少 GC 压力。
//
// 包含池统计信息、Get/Put 包装方法和统计重置功能。
//
// 作者xfy
package variable
import (
"sync/atomic"
)
// PoolStats 池统计信息。
//
// 记录 sync.Pool 的使用统计,用于监控和调试。
type PoolStats struct {
// Gets 从池中获取对象的次数
Gets int64
// Puts 放回池中对象的次数
Puts int64
// NewCount 调用 New 函数创建对象的次数
NewCount int64
// Active 当前活跃对象数量Gets - Puts
Active int64
}
var (
// gets 从池中获取对象的次数
gets atomic.Int64
// puts 放回池中对象的次数
puts atomic.Int64
// newCount 调用 New 函数创建对象的次数
newCount atomic.Int64
// active 当前活跃对象数量Gets - Puts
active atomic.Int64
)