Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
HostMetric
public
class
HostMetric
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.hostmetric.HostMetric
|
This class represents a host metric sample to be reported.
Summary
Public constructors |
HostMetric(String name, long timestamp, long value, data)
Constructor.
|
Public methods |
JSONObject
|
toJson()
Returns a JSON object for the metric sample.
|
Public constructors
HostMetric
public HostMetric (String name,
long timestamp,
long value,
data)
Constructor.
Parameters |
name |
String : name of the metric |
timestamp |
long : timestamp of the sample |
value |
long : value of the sample |
data |
: data associated with the sample |
Public methods
toJson
public JSONObject toJson ()
Returns a JSON object for the metric sample.
Returns |
JSONObject |
a JSON object. |
Throws |
|
org.json.JSONException |
JSONException |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-03-08 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-03-08 UTC."],[],[],null,["# HostMetric\n==========\n\n\n`\npublic\n\n\nclass\nHostMetric\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|-------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.util.hostmetric.HostMetric |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThis class represents a host metric sample to be reported.\n\nSummary\n-------\n\n| ### Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[HostMetric](../../../../../../../reference/tradefed/com/android/tradefed/util/hostmetric/HostMetric.html#HostMetric(java.lang.String,%20long,%20long,%20\u003cany\u003e))`(String name, long timestamp, long value, ` data) Constructor. |\n\n| ### Public methods ||\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` JSONObject` | ` `[toJson](../../../../../../../reference/tradefed/com/android/tradefed/util/hostmetric/HostMetric.html#toJson())`() ` Returns a JSON object for the metric sample. |\n\nPublic constructors\n-------------------\n\n### HostMetric\n\n```\npublic HostMetric (String name, \n long timestamp, \n long value, \n data)\n```\n\nConstructor.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|------------------------------------------|\n| `name` | `String`: name of the metric \u003cbr /\u003e |\n| `timestamp` | `long`: timestamp of the sample \u003cbr /\u003e |\n| `value` | `long`: value of the sample \u003cbr /\u003e |\n| `data` | : data associated with the sample \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### toJson\n\n```\npublic JSONObject toJson ()\n```\n\nReturns a JSON object for the metric sample.\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------------|-----------------------|\n| `JSONObject` | a JSON object. \u003cbr /\u003e |\n\n| Throws ||\n|-----------------|------------------------|\n| | org.json.JSONException |\n| `JSONException` | |"]]