- Add applesauce library reference documentation - Add rate limiting test report for Badger - Add memory monitoring for rate limiter (platform-specific implementations) - Enhance PID-controlled adaptive rate limiting - Update Neo4j and Badger monitors with improved load metrics - Add docker-compose configuration - Update README and configuration options 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
16 lines
622 B
Go
16 lines
622 B
Go
//go:build !linux && !(js && wasm)
|
|
|
|
package ratelimit
|
|
|
|
// ReadProcessMemoryStats returns memory statistics using Go runtime stats.
|
|
// On non-Linux platforms, we cannot read /proc/self/status, so we approximate
|
|
// using the Go runtime's memory statistics.
|
|
//
|
|
// Note: This is less accurate than the Linux implementation because:
|
|
// - runtime.MemStats.Sys includes memory reserved but not necessarily resident
|
|
// - We cannot distinguish shared vs anonymous memory
|
|
// - The values may not match what the OS reports for the process
|
|
func ReadProcessMemoryStats() ProcessMemoryStats {
|
|
return readProcessMemoryStatsFallback()
|
|
}
|