Upload Trace Processor Python API to PyPi
Bug: 163311756
Change-Id: I2372f0820bd37afe3156bd231731ae7f7317c70d
diff --git a/docs/analysis/trace-processor.md b/docs/analysis/trace-processor.md
index ce8f462..68307ed 100644
--- a/docs/analysis/trace-processor.md
+++ b/docs/analysis/trace-processor.md
@@ -429,10 +429,13 @@
downloaded or installed.
### Setup
-Note: The API is only compatible with Python3.
-
```
-from trace_processor.api import TraceProcessor
+pip install perfetto
+```
+NOTE: The API is only compatible with Python3.
+
+```python
+from perfetto.trace_processor import TraceProcessor
# Initialise TraceProcessor with a trace file
tp = TraceProcessor(file_path='trace.pftrace')
```
@@ -458,7 +461,7 @@
of the result.
```python
-from trace_processor.api import TraceProcessor
+from perfetto.trace_processor import TraceProcessor
tp = TraceProcessor(file_path='trace.pftrace')
qr_it = tp.query('SELECT ts, dur, name FROM slice')
@@ -477,7 +480,7 @@
The QueryResultIterator can also be converted to a Pandas DataFrame, although this
requires you to have both the `NumPy` and `Pandas` modules installed.
```python
-from trace_processor.api import TraceProcessor
+from perfetto.trace_processor import TraceProcessor
tp = TraceProcessor(file_path='trace.pftrace')
qr_it = tp.query('SELECT ts, dur, name FROM slice')
@@ -498,7 +501,7 @@
Furthermore, you can use the query result in a Pandas DataFrame format to easily
make visualisations from the trace data.
```python
-from trace_processor.api import TraceProcessor
+from perfetto.trace_processor import TraceProcessor
tp = TraceProcessor(file_path='trace.pftrace')
qr_it = tp.query('SELECT ts, value FROM counter WHERE track_id=50')
@@ -508,14 +511,14 @@
```
**Output**
-[](/docs/images/example_pd_graph.png)
+
#### Metric
The metric() function takes in a list of trace metrics and returns the results as a Protobuf.
-```
-from trace_processor.api import TraceProcessor
+```python
+from perfetto.trace_processor import TraceProcessor
tp = TraceProcessor(file_path='trace.pftrace')
ad_cpu_metrics = tp.metric(['android_cpu'])