Skip to content

Commit 86ebf45

Browse files
authored
User/anramanath/documentation (#189)
* init * Overview * Architecture. * WIP Moving about information * remove about info. * fixes in links. * tweak links. * bullet list. * Optional note. * Comments + gerund.
1 parent 3ed9796 commit 86ebf45

11 files changed

+108
-155
lines changed

documentation/Architecture/Overview.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ For more detailed information on how to create your own project using the SDK, p
77

88
## High-Level Interfaces
99

10-
The Microsoft Performance Toolkit SDK was built to empower users to analyze arbitrary data source (such as `.etl` files, `.ctf` files, SQL server logs, etc).
10+
The Microsoft Performance Toolkit SDK was built to empower users to analyze arbitrary data sources (e.g. `.etl` files, `.ctf` files, SQL server logs, `.csv` files, etc.).
1111
Users can develop extensible *SDK plugins* that contain logic for processing data sources into tables, which are sent to the *SDK driver* (such as
1212
the [Windows Performance Analyzer](https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer)) to render. At the highest
1313
level, it exposes the following interfaces:
@@ -17,20 +17,20 @@ level, it exposes the following interfaces:
1717

1818
The interfaces depicted in this diagram are
1919

20-
1) The SDK takes as input *data sources*, such as file paths, from the *SDK driver*. The SDK may receive this input when, for example, the user asks
20+
1) The SDK receives *data sources* (e.g. file paths) from the *SDK driver*. For example, the SDK may receive this input when the user asks
2121
the driver to open a file.
2222
2) The SDK passes the data sources to all *SDK plugins* which can support them. Plugins are
2323
loaded dynamically at runtime by the SDK driver before the data sources are given to the SDK. In this example, 2 out of the 3 loaded plugins advertise that
2424
they can handle the loaded data source.
2525
3) Plugins can optionally exchange data through *data cookers*, even if the two plugins do not have access to each others' source code. In this
2626
example, plugin B queries for and receives data from plugin A. Note that this data can be programmatically
27-
accessed by anyone - not just other plugins. See the Plugins section for more information.
27+
accessed by anyone - not just other plugins. See [Plugins](#Plugins) for more details.
2828
4) Each plugin given the data sources returns *tables* to the SDK. Note that a plugin which advertises support for a data source may return no tables, but that
2929
is unlikely to happen in practice.
3030
5) The SDK outputs all tables created by plugins to the SDK driver.
31-
6) The SDK driver does whatever it wishes with the tables. For example, WPA displays the tables along with interactable and manipulable graphs.
31+
6) The SDK driver does whatever it wishes with the tables. For example, WPA displays the tables along with interactable and manipulatable graphs.
3232

33-
Note that in this simplified example only *one* data source is given to the SDK. In practice, multiple data sources may be passed in simultatenously. The SDK
33+
Note that in this example only *one* data source is given to the SDK. In practice, multiple data sources may be passed in simultatenously. The SDK
3434
handles mapping data sources to the correct plugins, and each plugin sees as input a *list* of data sources for which it advertises support.
3535

3636
With these high-level interfaces defined, we will now examine each component in greater detail.
@@ -44,9 +44,9 @@ more programmatic drivers such as scripts may pass down hard-coded data sources.
4444

4545
We recommend using the [Windows Performance Analyzer](https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer)
4646
as the SDK driver since it grants a plethora of tools for performance analysis. For more information on how to install WPA,
47-
see [Using the SDK/Installing WPA](Using-the-SDK/Installing-WPA.md).
47+
see [Using the SDK/Installing WPA](../Using-the-SDK/Installing-WPA.md).
4848

49-
Creating an SDK driver is currently outside the scope of this documentation, although it may be added in the future.
49+
Creating an SDK driver is currently outside the scope of this documentation.
5050

5151

5252
## SDK

documentation/Architecture/The-Data-Processing-Pipeline.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ From an interface perspective, a `DataCooker` has the following properties:
5656
* A `DataCooker` processes (cooks) this data
5757
* A `DataCooker` exposes zero or more __data output__ properties
5858

59-
`DataOutput`s are the key component of data cookers, and are what achieve the last two goals outlined at the beginning of this document.
60-
The SDK is aware of every `DataOutput` a given `DataCooker` advertises, and any assembly with access to an instance of
61-
the SDK with a `DataCooker` loaded can query that cooker for any of its `DataOutput`s. For instance, a `Table` can
62-
query transformed data outputted by a `DataCooker` defined inside its own assembly:
59+
`DataOutput`s are the key component to `DataCooker`s as they achieve the last two goals outlined at the beginning of this document.
60+
The SDK is aware of every `DataOutput` a given `DataCooker` advertises. Any assembly the SDK loads concurrently with a `DataCooker` can query that cooker for any of its `DataOutput`s.
61+
For instance, a `Table` can query transformed data outputted by a `DataCooker` defined inside its own assembly:
6362

6463
<img src=".attachments/cooker_query.svg" width="800">
6564

@@ -87,21 +86,21 @@ The SDK handles these cases differently, so it is important to understand the di
8786

8887
#### Source Data Cookers
8988

90-
A `SourceDataCooker` is a `DataCooker` which consumes data from a single `SourceParser`. It must specify
91-
1) The `SourceParser` to consume data from and
89+
A `SourceDataCooker` is a `DataCooker` which must specify
90+
1) A single `SourceParser` to consume data from
9291
2) The keys of the events it wishes to receive
9392

9493
It is helpful to think of keys as "group names" here. A `SourceDataCooker` specifies the "groups," or "types," of
9594
events it wishes to receive.
9695

97-
Finally, a `SourceDataCooker` will consume (cook) events *one at a time* as the `SourceParser` emits them
96+
Finally, a `SourceDataCooker` will consume (cook) events *one at a time* as the `SourceParser` emits them.
9897

9998
#### Composite Data Cookers
10099

101100
A `CompositeDataCooker` is a `DataCooker` which consumes data from one or more other `DataCooker`s. It must
102101
specify all of the other `DataCookerPath`s for the `DataCooker`s which it depends upon. The SDK instructs
103102
the `CompositeDataCooker` when *all* of its dependencies have finished processing their data, at which point
104-
the `CompositeDataCooker` can query the `DataOutput`s it needs to perform *its* transformations.
103+
the `CompositeDataCooker` can query the `DataOutput`s it needs to perform *its own* transformations.
105104

106105
# Putting Everything Together
107106

documentation/Glossary.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
## AboutInfo
3434

35-
Exposes information about a plugin, such as its authors, copyright, and license. See [Adding About Information](./Using-the-SDK/Advanced/Adding-About-Information.md).
35+
Exposes information about a plugin, such as its authors, copyright, and license. See [Adding About Information](./Using-the-SDK/Creating-your-plugin.md#adding-about-information).
3636

3737
## Column
3838

@@ -48,7 +48,8 @@ See also: [Projection](#projection).
4848

4949
## ColumnRole
5050

51-
Meta-information about a [Column](#column) that defines the Column's role in data presentation. For example, a Column that contains a `Timestamp` whose value indicates when an event occured relative to the start of a [DataSource](#datasource) may be marked as a "start time" Column.
51+
Meta-information about a [Column](#column) that defines the Column's role in data presentation.
52+
For example, a Column of `Timestamp` values relative to the start of a [DataSource](#datasource) may be marked as a "start time" Column.
5253

5354
## CompositeDataCooker
5455

documentation/Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Overview
22
The Microsoft Performance Toolkit SDK allows developers to create "SDK plugins" that process and interpret data.
3-
These plugins can be used by performance analysis applications that use the SDK runtime - such as [Windows Performance Analyzer](https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer) - to process data sources into structured, tabular data. Plugins may utilize the SDK's data-processing pipeline to both facilitate the creation of these tables and expose data that can be programmatically accessed by concurrently loaded plugins (even those without access to the originating plugin's source code).
3+
These plugins can be used by performance analysis applications that use the SDK runtime - such as [Windows Performance Analyzer](https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer) - to process data sources into structured, tabular data. Plugins may use the SDK's data-processing pipeline to both facilitate the creation of these tables and expose data that can be programmatically accessed by concurrently loaded plugins (even those without access to the originating plugin's source code).
44

55
This folder contains instructions for developing SDK plugins and utilizing the SDK's various features.
66

documentation/Using-the-SDK/Advanced/Adding-About-Information.md

Lines changed: 0 additions & 93 deletions
This file was deleted.

documentation/Using-the-SDK/Advanced/Overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
The following collection of documents outline more advanced usages of the SDK.
44

5-
- [Adding About Information](Adding-About-Information.md)
65
- [Extending the SDK with your own implementations of `DataSource`](Creating-Your-Own-DataSource.md)
76
- [Making your Extensions Disposable](Disposable-Extensions.md)

documentation/Using-the-SDK/Building-a-table.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Building a Table
22

3-
Table construction happens by interacting with an instance of an `ITableBuilder`. Broadly, `Tables` consist of 3 parts: columns, which are composed of `ColumnConfigurations` and `Projections`, and `TableConfigurations`. An `ITableBuilder` has methods that accept all three of these objects.
3+
Table construction happens by interacting with an instance of an `ITableBuilder`. Broadly, `Tables` consist of `TableConfigurations` and Columns. Columns can be further broken down into `ColumnConfigurations` and `Projections`. An `ITableBuilder` has methods to add both Columns and `TableConfigurations`.
44

55
* [Column](#column)
66
* [ColumnConfiguration](#columnconfiguration)
77
* [Projection](#projection)
8-
* [Combining ColumnConfiguration and Projections](#combining-columnconfiguration-and-projections)
8+
* [Combining ColumnConfiguration and Projections](#combining-columnconfiguration-and-projections)
99
* [TableConfiguration](#tableconfiguration)
1010
* [ColumnRole](#columnrole)
1111

@@ -45,7 +45,7 @@ public sealed class WordTable
4545

4646
### Projection
4747

48-
A column's `Projection` is a function that maps a row index for a column to a piece of data. Projections are normally constructed at runtime by a `Build` method, since they depend on the data inside the final table. The SDK offers many helper methods for constructing `Projections`, such as
48+
A column's `Projection` is a function that maps a row index for a column to a piece of data. Projections are normally constructed at runtime by a `Build` method, since they depend on the data inside the final table. The SDK offers many helper methods for constructing `Projections`, such as:
4949
* `Projection.Index(IReadOnlyList<T> data)`, which projects a column index `i` to `data[i]`
5050
* `Projection.Compose(this IProjection<T1, T2>, Func<T2, TResult>)` which composes one `IProjection` with another method
5151

@@ -58,7 +58,7 @@ var lineNumberProjection = baseProjection.Compose(lineItem => lineItem.LineNumbe
5858
var wordCountProjection = baseProjection.Compose(lineItem => lineItem.Words.Count());
5959
```
6060

61-
## Combining ColumnConfiguration and Projections
61+
### Combining ColumnConfiguration and Projections
6262

6363
If we have the `ColumnConfigurations` and `Projections` above, we can add them to the table we're building by calling `ITableBuilder.AddColumn`:
6464

@@ -102,7 +102,7 @@ tableBuilder.SetDefaultTableConfiguration(tableConfig);
102102

103103
### ColumnRole
104104

105-
A `ColumnRole` is metadata information about a column that defines the column's role in data presentation. For example, a column that contains a `Timestamp` whose value indicates when an event occured relative to the start of a `DataSource`](#datasource)` may be marked as a "start time" Column:
105+
A `ColumnRole` is metadata information about a column that defines the column's role in data presentation. For example, a column of `Timestamp` values relative to the start of a `DataSource` may be marked as a "start time" Column:
106106

107107
```cs
108108
tableConfig.AddColumnRole(ColumnRole.StartTime, relativeTimestampColumnConfiguration);

documentation/Using-the-SDK/Creating-a-pipeline.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ This document assumes you have already created a `ProcessingSource` and your plu
88

99
The data-processing pipeline plugin framework is centered around a `SourceParser` and one-or-more `DataCookers`. The `CustomDataProcessor` your `ProcessingSource` creates delegates the task of parsing `DataSources` off to a `SourceParser`, who in turn emits __events__ that flow through `DataCookers`. In this framework, `Tables` are responsible for "building themselves" by querying `DataCookers` for their `DataOutputs`.
1010

11-
This document is outlined into 4 distinct steps
12-
* [Creating a SourceParser](#creating-a-sourceparser)
13-
* [Creating a CustomDataProcessorWithSourceParser](#creating-a-customdataprocessorwithsourceparser)
14-
* [Linking Your CustomDataProcessor to Your ProcessingSource](#linking-your-customdataprocessor-to-your-processingsource)
15-
* [Creating a DataCooker](#creating-a-datacooker)
11+
There are 4 distinct steps in creating a Data-Processing Pipeline:
12+
1. [Creating a SourceParser](#creating-a-sourceparser)
13+
2. [Creating a CustomDataProcessorWithSourceParser](#creating-a-customdataprocessorwithsourceparser)
14+
3. [Linking Your CustomDataProcessor to Your ProcessingSource](#linking-your-customdataprocessor-to-your-processingsource)
15+
4. [Creating a DataCooker](#creating-a-datacooker)
1616

1717
## Creating a SourceParser
1818

documentation/Using-the-SDK/Creating-a-simple-sdk-plugin.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ In this framework, your `CustomDataProcessor` is responsible for
1212

1313
> :information_source: When using the simple plugin framework, a `Table` is referred to as a `Simple Table`.
1414
15-
This document is outlined into 4 distinct steps
16-
* [Creating a CustomDataProcessor](#creating-a-customdataprocessor)
17-
* [Creating a Simple Table](#creating-a-simple-table)
18-
* [Building Your Simple Table](#building-your-simple-table)
19-
* [Linking Your CustomDataProcessor to Your ProcessingSource](#linking-your-customdataprocessor-to-your-processingsource)
15+
There are 4 distinct steps in creating a Simple SDK Plugin:
16+
1. [Creating a CustomDataProcessor](#creating-a-customdataprocessor)
17+
2. [Creating a Simple Table](#creating-a-simple-table)
18+
3. [Building Your Simple Table](#building-your-simple-table)
19+
4. [Linking Your CustomDataProcessor to Your ProcessingSource](#linking-your-customdataprocessor-to-your-processingsource)
2020

2121
## Creating a CustomDataProcessor
2222

0 commit comments

Comments
 (0)