test: 尝试启用xray splice拷贝

This commit is contained in:
wyx2685
2025-08-22 05:22:47 +09:00
parent 7d52a8932d
commit 6e8297c553
9 changed files with 473 additions and 454 deletions

View File

@@ -0,0 +1,25 @@
package counter
import (
"sync/atomic"
fstats "github.com/xtls/xray-core/features/stats"
)
var _ fstats.Counter = (*XrayTrafficCounter)(nil)
type XrayTrafficCounter struct {
V *atomic.Int64
}
func (c *XrayTrafficCounter) Value() int64 {
return c.V.Load()
}
func (c *XrayTrafficCounter) Set(newValue int64) int64 {
return c.V.Swap(newValue)
}
func (c *XrayTrafficCounter) Add(delta int64) int64 {
return c.V.Add(delta)
}