ResourceMetricUtil

public class ResourceMetricUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.monitoring.collector.ResourceMetricUtil


ฟังก์ชันยูทิลิตีสําหรับการเขียนเมตริก

สรุป

ตัวสร้างแบบสาธารณะ

ResourceMetricUtil()

เมธอดสาธารณะ

static float ConvertedMetricValue(String original, float conversionDivisor)

แปลงค่าเมตริกเป็นหน่วยอื่นและจัดรูปแบบค่าเอาต์พุต

static GetCommandResponse(IDeviceManager deviceManager, String serial, String cmd, long timeoutMs)

ดำเนินการตามคําสั่ง adb และแสดงผลลัพธ์หากสําเร็จ

static Timestamp GetCurrentTimestamp()

รับการประทับเวลาปัจจุบันจากนาฬิกา UTC ของระบบ

static float RoundedMetricValue(String original)

แยกวิเคราะห์และจัดรูปแบบค่าเมตริก

ตัวสร้างแบบสาธารณะ

ResourceMetricUtil

public ResourceMetricUtil ()

เมธอดสาธารณะ

ConvertedMetricValue

public static float ConvertedMetricValue (String original, 
                float conversionDivisor)

แปลงค่าเมตริกเป็นหน่วยอื่นและจัดรูปแบบค่าเอาต์พุต

พารามิเตอร์
original String: สตริงค่าเดิม

conversionDivisor float: ตัวหารสำหรับการแปลงหน่วย

คิกรีเทิร์น
float ค่าทศนิยมเอาต์พุต

การโยน
NumberFormatException หากสตริงต้นฉบับเป็น Null

GetCommandResponse

public static  GetCommandResponse (IDeviceManager deviceManager, 
                String serial, 
                String cmd, 
                long timeoutMs)

ดำเนินการตามคําสั่ง adb และแสดงผลลัพธ์หากสําเร็จ

พารามิเตอร์
deviceManager IDeviceManager: อินสแตนซ์ IDeviceManager สำหรับเรียกใช้คําสั่งในอุปกรณ์ที่ "พร้อมใช้งาน"

serial String: ซีเรียลของอุปกรณ์

cmd String: สตริงคําสั่ง

timeoutMs long: เวลาที่รอเป็นมิลลิวินาที

คิกรีเทิร์น
อินสแตนซ์ CommandResult

GetCurrentTimestamp

public static Timestamp GetCurrentTimestamp ()

รับการประทับเวลาปัจจุบันจากนาฬิกา UTC ของระบบ

คิกรีเทิร์น
Timestamp

RoundedMetricValue

public static float RoundedMetricValue (String original)

แยกวิเคราะห์และจัดรูปแบบค่าเมตริก

พารามิเตอร์
original String: สตริงค่าเดิม

คิกรีเทิร์น
float ค่าทศนิยมเอาต์พุต

การโยน
NumberFormatException หากสตริงต้นฉบับเป็น Null