summaryrefslogtreecommitdiffstats
path: root/core/java/android/os
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-10-30 20:02:13 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-10-30 20:02:13 -0400
commite8228afb2bd005ae25ce58719f9d678389b26a16 (patch)
tree0688468ffaae7e02c4c9caa9218c4fb83b572b55 /core/java/android/os
parent77bd91f8af44867935ea2df22f69fb244b009b94 (diff)
parent075997f12e2fb2b646172a92926be0f26f739099 (diff)
downloadframeworks_base-e8228afb2bd005ae25ce58719f9d678389b26a16.zip
frameworks_base-e8228afb2bd005ae25ce58719f9d678389b26a16.tar.gz
frameworks_base-e8228afb2bd005ae25ce58719f9d678389b26a16.tar.bz2
Merge change I92cdc5ed into eclair
* changes: PerformanceCollector: Collect & report perf measurements in key/value form
Diffstat (limited to 'core/java/android/os')
-rw-r--r--core/java/android/os/PerformanceCollector.java63
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.
*/