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)

यह दी गई adb shell कमांड को, simpleperf के साथ रैप करके एक्ज़ीक्यूट करता है

कॉल करने वाले व्यक्ति की यह ज़िम्मेदारी है कि वह रिसीवर के ज़रिए simpleperf के नतीजे को पार्स करे

SimplePerfResult executeCommand(String command)

यह दी गई adb shell कमांड को, simpleperf के साथ रैप करके एक्ज़ीक्यूट करता है

Simpleperf के नतीजे को पार्स किया जाएगा और कॉलर को भेजा जाएगा

void executeCommand(String command, IShellOutputReceiver receiver)

यह दी गई adb shell कमांड को, simpleperf के साथ रैप करके एक्ज़ीक्यूट करता है

कॉल करने वाले व्यक्ति की यह ज़िम्मेदारी है कि वह रिसीवर के ज़रिए 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)

यह दी गई adb shell कमांड को, simpleperf के साथ रैप करके एक्ज़ीक्यूट करता है

कॉल करने वाले व्यक्ति की यह ज़िम्मेदारी है कि वह रिसीवर के ज़रिए simpleperf के नतीजे को पार्स करे

पैरामीटर
command String: डिवाइस पर चलाने के लिए कमांड

receiver IShellOutputReceiver: IShellOutputReceiver ऑब्जेक्ट, जिसका इस्तेमाल शेल आउटपुट को डायरेक्ट करने के लिए किया जाता है

maxTimeToOutputShellResponse long: वह ज़्यादा से ज़्यादा समय जिसके दौरान कमांड को कोई जवाब नहीं देना होता; यूनिट, timeUnit में बताई गई है

timeUnit TimeUnit: maxTimeToOutputShellResponse के लिए timeUnit यूनिट, TimeUnit देखें

retryAttempts int: अगर किसी अपवाद की वजह से कमांड काम नहीं करती है, तो उसे ज़्यादा से ज़्यादा कितनी बार फिर से आज़माया जा सकता है. अगर retryAttempts को पूरा नहीं किया जाता है, तो DeviceNotResponsiveException थ्रो किया जाएगा.

थ्रो
DeviceNotAvailableException अगर डिवाइस से कनेक्शन टूट जाता है और उसे वापस नहीं लाया जा सकता

executeCommand

public SimplePerfResult executeCommand (String command)

यह दी गई adb shell कमांड को, simpleperf के साथ रैप करके एक्ज़ीक्यूट करता है

Simpleperf के नतीजे को पार्स किया जाएगा और कॉलर को भेजा जाएगा

पैरामीटर
command String: डिवाइस पर चलाने के लिए कमांड

रिटर्न
SimplePerfResult SimplePerfResult ऑब्जेक्ट में नतीजे की पूरी जानकारी होती है

थ्रो
DeviceNotAvailableException अगर डिवाइस से कनेक्शन टूट जाता है और उसे वापस नहीं लाया जा सकता

executeCommand

public void executeCommand (String command, 
                IShellOutputReceiver receiver)

यह दी गई adb shell कमांड को, simpleperf के साथ रैप करके एक्ज़ीक्यूट करता है

कॉल करने वाले व्यक्ति की यह ज़िम्मेदारी है कि वह रिसीवर के ज़रिए simpleperf के नतीजे को पार्स करे

पैरामीटर
command String: डिवाइस पर चलाने के लिए कमांड

receiver IShellOutputReceiver: IShellOutputReceiver ऑब्जेक्ट, जिसका इस्तेमाल शेल आउटपुट को डायरेक्ट करने के लिए किया जाता है

थ्रो
DeviceNotAvailableException अगर डिवाइस से कनेक्शन टूट जाता है और उसे वापस नहीं लाया जा सकता

getArgumentList

public List<String> getArgumentList ()

simpleperf कमांड के लिए आर्ग्युमेंट पाना

रिटर्न
List<String> सबकमांड और आर्ग्युमेंट की सूची (शून्य हो सकता है)

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