Documentation
¶
Overview ¶
Package resourced contains utilities for communicating with the Resource Manager daemon (resourced).
Index ¶
- Constants
- type ChromePressureSignal
- type ChromePressureWatcher
- type Client
- func (c *Client) AvailableMemoryKB(ctx context.Context) (uint64, error)
- func (c *Client) ComponentMemoryMarginsKB(ctx context.Context) (ComponentMemoryMargins, error)
- func (c *Client) ForegroundAvailableMemoryKB(ctx context.Context) (uint64, error)
- func (c *Client) FullscreenVideo(ctx context.Context) (uint8, error)
- func (c *Client) GameMode(ctx context.Context) (uint8, error)
- func (c *Client) MemoryMarginsKB(ctx context.Context) (Margins, error)
- func (c *Client) NewChromePressureWatcher(ctx context.Context) (*ChromePressureWatcher, error)
- func (c *Client) RTCAudioActive(ctx context.Context) (uint8, error)
- func (c *Client) SetFullscreenVideoWithTimeout(ctx context.Context, fullscreenVideo uint8, timeout uint32) error
- func (c *Client) SetGameMode(ctx context.Context, mode uint8) error
- func (c *Client) SetGameModeWithTimeout(ctx context.Context, mode uint8, timeout uint32) error
- func (c *Client) SetRTCAudioActive(ctx context.Context, mode uint8) error
- type ComponentMemoryMargins
- type Margins
Constants ¶
const ( // GameModeOff means no component managed by Resource Manager is in game // mode. GameModeOff = 0 // GameModeBorealis means borealis is in game mode. GameModeBorealis = 1 // ChromePressureLevelNone means no reduction of memory in chrome is needed. ChromePressureLevelNone = 0 // ChromePressureLevelModerate means Chrome is advised to free buffers that // are cheap to re-allocate and are not immediately needed. ChromePressureLevelModerate = 1 // ChromePressureLevelCritical means Chrome is advised to free all possible // memory. ChromePressureLevelCritical = 2 // RTCAudioActiveOff means RTCAudioActive is off. RTCAudioActiveOff uint8 = 0 // RTCAudioActiveOn means RTCAudioActive is on. RTCAudioActiveOn uint8 = 1 // FullscreenVideoInactive means full screen video is not active. FullscreenVideoInactive uint8 = 0 // FullscreenVideoActive means full screen video is active. FullscreenVideoActive uint8 = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChromePressureSignal ¶
ChromePressureSignal holds values created from the MemoryPressureChrome D-Bus signal.
type ChromePressureWatcher ¶
type ChromePressureWatcher struct { Signals chan ChromePressureSignal // contains filtered or unexported fields }
ChromePressureWatcher converts the MemoryPressureChrome D-Bus signal to a channel of ChromePressureSignal.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps D-Bus calls to make requests to the Resource Manager (resourced).
func NewClient ¶
NewClient makes a new D-Bus wrapper object for communicating with Resource Manager.
func (*Client) AvailableMemoryKB ¶
AvailableMemoryKB returns the result of the GetAvailableMemoryKB D-Bus method.
func (*Client) ComponentMemoryMarginsKB ¶
func (c *Client) ComponentMemoryMarginsKB(ctx context.Context) (ComponentMemoryMargins, error)
ComponentMemoryMarginsKB returns the result of the GetComponentMemoryMarginsKB D-Bus method.
func (*Client) ForegroundAvailableMemoryKB ¶
ForegroundAvailableMemoryKB returns the result of the GetForegroundAvailableMemoryKB D-Bus method.
func (*Client) FullscreenVideo ¶
FullscreenVideo returns the result of the GetFullscreenVideo D-Bus method.
func (*Client) MemoryMarginsKB ¶
MemoryMarginsKB returns the result of the GetMemoryMarginsKB D-Bus method.
func (*Client) NewChromePressureWatcher ¶
func (c *Client) NewChromePressureWatcher(ctx context.Context) (*ChromePressureWatcher, error)
NewChromePressureWatcher starts listening for MemoryPressureChrome D-Bus signals. Call ChromePressureWatcher.Close when finished.
func (*Client) RTCAudioActive ¶
RTCAudioActive returns the result of the GetRTCAudioActive D-Bus method.
func (*Client) SetFullscreenVideoWithTimeout ¶
func (c *Client) SetFullscreenVideoWithTimeout(ctx context.Context, fullscreenVideo uint8, timeout uint32) error
SetFullscreenVideoWithTimeout sets the full screen video state in resourced, the state will be reset after timeout seconds.
func (*Client) SetGameMode ¶
SetGameMode sets the game mode state in resourced.
func (*Client) SetGameModeWithTimeout ¶
SetGameModeWithTimeout sets the game mode state in resourced, the game mode will be reset after timeout seconds.
type ComponentMemoryMargins ¶
type ComponentMemoryMargins struct {
ChromeCriticalKB, ChromeModerateKB, ArcVMForegroundKB, ArcVMPerceptibleKB, ArcVMCachedKB uint64
}
ComponentMemoryMargins holds the component margins returned from Resource Manager.