summaryrefslogtreecommitdiffstats
path: root/core/java/android/os
diff options
context:
space:
mode:
authorJack Wang <jackwang@google.com>2009-10-30 17:07:56 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-30 17:07:56 -0700
commit227ba2072df1474a0b3abaae7c415f152d32bcc2 (patch)
tree70312f7e89f69d5ae9d6128c25e2237863ffe512 /core/java/android/os
parentcbf583d7229aaff65734b4234e81db8ead864761 (diff)
parente8228afb2bd005ae25ce58719f9d678389b26a16 (diff)
downloadframeworks_base-227ba2072df1474a0b3abaae7c415f152d32bcc2.zip
frameworks_base-227ba2072df1474a0b3abaae7c415f152d32bcc2.tar.gz
frameworks_base-227ba2072df1474a0b3abaae7c415f152d32bcc2.tar.bz2
am e8228afb: Merge change I92cdc5ed into eclair
Merge commit 'e8228afb2bd005ae25ce58719f9d678389b26a16' into eclair-mr2 * commit 'e8228afb2bd005ae25ce58719f9d678389b26a16': 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.
*/