Documentation
¶
Overview ¶
Package inputlatency contains functions and structs used for measuring input latency on ARC.
Index ¶
- func AndroidData() []string
- func CalculateMetrics(events []InputEvent, getValue func(int) float64) (mean, median, stdDev, max, min float64)
- func EvaluateLatency(ctx context.Context, s *testing.State, d *ui.Device, numEvents int, ...) error
- func InstallArcHostClockClient(ctx context.Context, a *arc.ARC, s *testing.State) error
- func Now() (int64, error)
- func WaitForClearUI(ctx context.Context, d *ui.Device) error
- func WaitForEvents(ctx context.Context, d *ui.Device, count int) (string, error)
- func WaitForNextEventTime(ctx context.Context, a *arc.ARC, eventTimes *[]int64, ms time.Duration) error
- type InputEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AndroidData ¶
func AndroidData() []string
AndroidData is the list of data dependencies that tests need to add to their testing.Test.Data in order to use arc-host-clock-client.
func CalculateMetrics ¶
func CalculateMetrics(events []InputEvent, getValue func(int) float64) (mean, median, stdDev, max, min float64)
CalculateMetrics calculates mean, median, std dev, max and min for the given input events. The function getValue should return the value of the element corresponding to the given index.
func EvaluateLatency ¶
func EvaluateLatency(ctx context.Context, s *testing.State, d *ui.Device, numEvents int, eventTimes []int64, perfName string, pv *perf.Values) error
EvaluateLatency gets event data, calculates the latency, and adds the result to performance metrics.
func InstallArcHostClockClient ¶
InstallArcHostClockClient installs the arc-host-clock-client test binary.
func WaitForClearUI ¶
WaitForClearUI clears the event data in ArcInputLatencyTest.apk to get ready for next event tracing.
func WaitForEvents ¶
WaitForEvents polls until the counter in the app UI is equal to count, then returns the input events from the helper app.
Types ¶
type InputEvent ¶
type InputEvent struct { // Time (in ns) that the event was sent by the kernel (filled by host). EventTimeNS int64 // Time (in ns) that the event was received by the app. RecvTimeNS int64 `json:"receiveTimeNs"` }
InputEvent represents a single input event received by the helper app.