inputlatency

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package inputlatency contains functions and structs used for measuring input latency on ARC.

Index

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

func InstallArcHostClockClient(ctx context.Context, a *arc.ARC, s *testing.State) error

InstallArcHostClockClient installs the arc-host-clock-client test binary.

func Now

func Now() (int64, error)

Now returns the current time in nanoseconds from CLOCK_BOOTTIME.

func WaitForClearUI

func WaitForClearUI(ctx context.Context, d *ui.Device) error

WaitForClearUI clears the event data in ArcInputLatencyTest.apk to get ready for next event tracing.

func WaitForEvents

func WaitForEvents(ctx context.Context, d *ui.Device, count int) (string, error)

WaitForEvents polls until the counter in the app UI is equal to count, then returns the input events from the helper app.

func WaitForNextEventTime

func WaitForNextEventTime(ctx context.Context, a *arc.ARC, eventTimes *[]int64, ms time.Duration) error

WaitForNextEventTime generates next event time with specific time interval in millisecond.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL