diff options
Diffstat (limited to 'core/java/android/os')
| -rw-r--r-- | core/java/android/os/PerformanceCollector.java | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/core/java/android/os/PerformanceCollector.java b/core/java/android/os/PerformanceCollector.java index 4ca1f32..be1cf6d 100644 --- a/core/java/android/os/PerformanceCollector.java +++ b/core/java/android/os/PerformanceCollector.java @@ -107,6 +107,36 @@ public class PerformanceCollector { * @see PerformanceCollector#stopTiming(String) */ public void writeStopTiming(Bundle results); + + /** + * Callback invoked as last action in + * {@link PerformanceCollector#addMeasurement(String, long)} for + * reporting an integer type measurement. + * + * @param label short description of the metric that was measured + * @param value long value of the measurement + */ + public void writeMeasurement(String label, long value); + + /** + * Callback invoked as last action in + * {@link PerformanceCollector#addMeasurement(String, float)} for + * reporting a float type measurement. + * + * @param label short description of the metric that was measured + * @param value float value of the measurement + */ + public void writeMeasurement(String label, float value); + + /** + * Callback invoked as last action in + * {@link PerformanceCollector#addMeasurement(String, String)} for + * reporting a string field. + * + * @param label short description of the metric that was measured + * @param value string summary of the measurement + */ + public void writeMeasurement(String label, String value); } /** @@ -385,6 +415,39 @@ public class PerformanceCollector { return mPerfMeasurement; } + /** + * Add an integer type measurement to the collector. + * + * @param label short description of the metric that was measured + * @param value long value of the measurement + */ + public void addMeasurement(String label, long value) { + if (mPerfWriter != null) + mPerfWriter.writeMeasurement(label, value); + } + + /** + * Add a float type measurement to the collector. + * + * @param label short description of the metric that was measured + * @param value float value of the measurement + */ + public void addMeasurement(String label, float value) { + if (mPerfWriter != null) + mPerfWriter.writeMeasurement(label, value); + } + + /** + * Add a string field to the collector. + * + * @param label short description of the metric that was measured + * @param value string summary of the measurement + */ + public void addMeasurement(String label, String value) { + if (mPerfWriter != null) + mPerfWriter.writeMeasurement(label, value); + } + /* * Starts tracking memory usage, binder transactions, and real & cpu timing. */ |
