microsoft-performance-toolkit-sdk icon indicating copy to clipboard operation
microsoft-performance-toolkit-sdk copied to clipboard

SDK should support Specialized Column

Open helenkzhang opened this issue 2 years ago • 0 comments

Overview

The SDK currently defines a column as a conceptual pair of Column Configuration and Projection. When a column is added to a table builder, it is associated with one single projection and one single configuration. However, there are use cases where a column is expected to have special modes – different ways of projecting and displaying the column data – that can be specified and changed at runtime. For example, a process column should be able to display process name only, PID only or both process name and PID. Currently the functionality of extending a column can only be implemented in the SDK driver but not in the plugin because of the lack of support from the SDK. This hinders plugin authors from creating their own column extensions and introduces unwanted plugin-specific code into the SDK driver. To address this, we want to introduce the concept of Specialized Column and add support for creating these columns using the SDK.

Proposed Solution

Functionalities to support

Build a specialized column

  • Create a column extender that provides APIs needed to create a specific column variation and stores a column extension descriptor as the key to identify an extension mode
  • Create a specialized column (regular or hierarchical) that stores a collection of supported column extenders

Add a specialized column to a table

  • Add a specialized column to a table
  • Add new extenders to an already created specialized column

Configure a specialized column

  • Define a set of customized configurable column extension properties associated with a specialized column (e.g. a boolean that specifies whether a specialized hierarchical column should be fold). These properties will be used by the extender to build projection and potentially other column properties. To avoid arbitrary types, we can define an enum of supported "types" of configurable properties and have the properties be of type ExtensionProperty which itself has a property of this enum
  • Create an extended column configuration that specifies an extension mode and the properties values associated with the specialized column

Code sample with new types and APIs

helenkzhang avatar Sep 07 '22 23:09 helenkzhang