SimplePerfUtil

public class SimplePerfUtil
extends Object

java.lang.Object
com.android.tradefed.util.SimplePerfUtil


간단한 명령어를 전달하고 결과를 수집하는 유틸리티 클래스

요약

공개 메서드

void executeCommand(String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

simpleperf가 래핑된 상태로 지정된 adb 셸 명령어를 실행합니다.

호출자는 수신기를 통해 simpleperf 결과를 파싱해야 합니다.

SimplePerfResult executeCommand(String command)

simpleperf가 래핑된 상태로 지정된 adb 셸 명령어를 실행합니다.

simpleperf 결과가 파싱되어 호출자에게 반환됩니다.

void executeCommand(String command, IShellOutputReceiver receiver)

simpleperf가 래핑된 상태로 지정된 adb 셸 명령어를 실행합니다.

호출자는 수신기를 통해 simpleperf 결과를 파싱해야 합니다.

List<String> getArgumentList()

simpleperf 명령어의 인수를 가져옵니다.

static SimplePerfUtil newInstance(ITestDevice device, SimplePerfUtil.SimplePerfType type)

SimplePerfUtil 생성자

호출자는 인스턴스를 초기화할 때 기기 및 simpleperf 유형을 정의해야 합니다.

void setArgumentList(List<String> arguList)

simpleperf 명령어에 인수를 설정합니다.

보호된 메서드

String commandStringPreparer(String command)

공개 메서드

executeCommand

public void executeCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

simpleperf가 래핑된 상태로 지정된 adb 셸 명령어를 실행합니다.

호출자는 수신기를 통해 simpleperf 결과를 파싱해야 합니다.

매개변수
command String: 기기에서 실행할 명령어

receiver IShellOutputReceiver: 셸 출력을 전달할 IShellOutputReceiver 객체

maxTimeToOutputShellResponse long: 명령어가 응답을 출력하지 않도록 허용되는 최대 시간입니다. 단위는 timeUnit에 지정된 대로입니다.

timeUnit TimeUnit: maxTimeToOutputShellResponse의 timeUnit 단위입니다. TimeUnit을 참고하세요.

retryAttempts int: 예외로 인해 실패하는 경우 명령어를 재시도할 최대 횟수입니다. 재시도가 성공하지 않고 실행되면 retryAttempts이 발생합니다.

생성 값
DeviceNotAvailableException 기기와의 연결이 끊어지고 복구할 수 없는 경우

executeCommand

public SimplePerfResult executeCommand (String command)

simpleperf가 래핑된 상태로 지정된 adb 셸 명령어를 실행합니다.

simpleperf 결과가 파싱되어 호출자에게 반환됩니다.

매개변수
command String: 기기에서 실행할 명령어

반환
SimplePerfResult SimplePerfResult 객체에는 모든 결과 정보가 포함됩니다.

생성 값
DeviceNotAvailableException 기기와의 연결이 끊어지고 복구할 수 없는 경우

executeCommand

public void executeCommand (String command, 
                IShellOutputReceiver receiver)

simpleperf가 래핑된 상태로 지정된 adb 셸 명령어를 실행합니다.

호출자는 수신기를 통해 simpleperf 결과를 파싱해야 합니다.

매개변수
command String: 기기에서 실행할 명령어

receiver IShellOutputReceiver: 셸 출력을 전달할 IShellOutputReceiver 객체

생성 값
DeviceNotAvailableException 기기와의 연결이 끊어지고 복구할 수 없는 경우

getArgumentList

public List<String> getArgumentList ()

simpleperf 명령어의 인수를 가져옵니다.

반환
List<String> 하위 명령어 및 인수 목록 (null 허용)

newInstance

public static SimplePerfUtil newInstance (ITestDevice device, 
                SimplePerfUtil.SimplePerfType type)

SimplePerfUtil 생성자

호출자는 인스턴스를 초기화할 때 기기 및 simpleperf 유형을 정의해야 합니다.

매개변수
device ITestDevice: ITestDevice 테스트 기기

type SimplePerfUtil.SimplePerfType: SimplePerfType은 simpleperf 모드를 나타냅니다.

반환
SimplePerfUtil 새로 생성된 SimplePerfUtil 인스턴스

생성 값
NullPointerException

setArgumentList

public void setArgumentList (List<String> arguList)

simpleperf 명령어에 인수를 설정합니다.

매개변수
arguList List: 하위 명령어 및 인수 목록

보호된 메서드

commandStringPreparer

protected String commandStringPreparer (String command)

매개변수
command String

반환 값
String