diff --git a/src/Microsoft.Performance.SDK.Runtime.Tests/TableConfigurationSerializationTests.cs b/src/Microsoft.Performance.SDK.Runtime.Tests/TableConfigurationSerializationTests.cs
index e8b8269a..3ebc448a 100644
--- a/src/Microsoft.Performance.SDK.Runtime.Tests/TableConfigurationSerializationTests.cs
+++ b/src/Microsoft.Performance.SDK.Runtime.Tests/TableConfigurationSerializationTests.cs
@@ -10,6 +10,7 @@
using Microsoft.Performance.Testing;
using Microsoft.Performance.Testing.SDK;
using Microsoft.VisualStudio.TestTools.UnitTesting;
+using ColumnConfiguration = Microsoft.Performance.SDK.Runtime.DTO.Latest.ColumnConfiguration;
using TableConfiguration = Microsoft.Performance.SDK.Processing.TableConfiguration;
namespace Microsoft.Performance.SDK.Runtime.Tests
@@ -286,7 +287,7 @@ private DTO.PreV1.TableConfiguration BuildPreV1TableConfig()
StartTimeColumnGuid = Guid.NewGuid(),
StartTimeColumnName = testStr()
}, 3).ToArray(),
- Columns = Enumerable.Repeat(new DTO.ColumnConfiguration()
+ Columns = Enumerable.Repeat(new DTO.V1_0.ColumnConfiguration()
{
Metadata = new DTO.ColumnMetadata()
{
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/DTOExtensions.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/DTOExtensions.cs
index f719e1c7..68c7ac8c 100644
--- a/src/Microsoft.Performance.SDK.Runtime/DTO/DTOExtensions.cs
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/DTOExtensions.cs
@@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Performance.SDK.Runtime.DTO.Enums;
+using Microsoft.Performance.SDK.Runtime.DTO.Latest;
namespace Microsoft.Performance.SDK.Runtime.DTO
{
@@ -431,7 +432,8 @@ private static Microsoft.Performance.SDK.Processing.ColumnConfiguration ConvertT
var columnConfiguration = new Microsoft.Performance.SDK.Processing.ColumnConfiguration(
dto.Metadata.ConvertToSdk(),
- dto.DisplayHints.ConvertToSdk());
+ dto.DisplayHints.ConvertToSdk(),
+ dto.VariantGuid);
return columnConfiguration;
}
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/ColumnConfiguration.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/Latest/ColumnConfiguration.cs
similarity index 67%
rename from src/Microsoft.Performance.SDK.Runtime/DTO/ColumnConfiguration.cs
rename to src/Microsoft.Performance.SDK.Runtime/DTO/Latest/ColumnConfiguration.cs
index 0ff90760..ed67d412 100644
--- a/src/Microsoft.Performance.SDK.Runtime/DTO/ColumnConfiguration.cs
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/Latest/ColumnConfiguration.cs
@@ -1,9 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+using System;
using System.Runtime.Serialization;
-namespace Microsoft.Performance.SDK.Runtime.DTO
+namespace Microsoft.Performance.SDK.Runtime.DTO.Latest
{
[DataContract]
internal class ColumnConfiguration
@@ -14,6 +15,12 @@ internal class ColumnConfiguration
[DataMember]
public ColumnMetadata Metadata { get; set; }
+ ///
+ /// The unique identifier of the column variant to use.
+ ///
+ [DataMember]
+ public Guid? VariantGuid { get; set; }
+
///
/// UI hints for displaying the column.
///
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/PrebuiltConfigurations.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/Latest/PrebuiltConfigurations.cs
similarity index 78%
rename from src/Microsoft.Performance.SDK.Runtime/DTO/PrebuiltConfigurations.cs
rename to src/Microsoft.Performance.SDK.Runtime/DTO/Latest/PrebuiltConfigurations.cs
index 712668f3..1a239fe3 100644
--- a/src/Microsoft.Performance.SDK.Runtime/DTO/PrebuiltConfigurations.cs
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/Latest/PrebuiltConfigurations.cs
@@ -3,13 +3,13 @@
using System.Runtime.Serialization;
-namespace Microsoft.Performance.SDK.Runtime.DTO
+namespace Microsoft.Performance.SDK.Runtime.DTO.Latest
{
[DataContract]
internal class PrebuiltConfigurations
: PrebuiltConfigurationsBase
{
- internal static readonly double DTOVersion = 1.0;
+ internal static readonly double DTOVersion = 1.3;
public PrebuiltConfigurations()
{
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/TableConfiguration.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/Latest/TableConfiguration.cs
similarity index 96%
rename from src/Microsoft.Performance.SDK.Runtime/DTO/TableConfiguration.cs
rename to src/Microsoft.Performance.SDK.Runtime/DTO/Latest/TableConfiguration.cs
index fe506ed9..508fd892 100644
--- a/src/Microsoft.Performance.SDK.Runtime/DTO/TableConfiguration.cs
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/Latest/TableConfiguration.cs
@@ -6,7 +6,7 @@
using System.Runtime.Serialization;
using Microsoft.Performance.SDK.Runtime.DTO.Enums;
-namespace Microsoft.Performance.SDK.Runtime.DTO
+namespace Microsoft.Performance.SDK.Runtime.DTO.Latest
{
[DataContract]
internal class TableConfiguration
@@ -93,7 +93,7 @@ internal class TableConfiguration
/// Columns that may appear in the table.
///
[DataMember(Order = 14)]
- public IEnumerable Columns { get; set; }
+ public IEnumerable Columns { get; set; }
///
/// The roles and their associated column entries.
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/TableConfigurations.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/Latest/TableConfigurations.cs
similarity index 89%
rename from src/Microsoft.Performance.SDK.Runtime/DTO/TableConfigurations.cs
rename to src/Microsoft.Performance.SDK.Runtime/DTO/Latest/TableConfigurations.cs
index 5b2446f6..c41ef3b4 100644
--- a/src/Microsoft.Performance.SDK.Runtime/DTO/TableConfigurations.cs
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/Latest/TableConfigurations.cs
@@ -4,7 +4,7 @@
using System;
using System.Runtime.Serialization;
-namespace Microsoft.Performance.SDK.Runtime.DTO
+namespace Microsoft.Performance.SDK.Runtime.DTO.Latest
{
[DataContract]
internal class TableConfigurations
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/PrebuiltConfigurations.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/PrebuiltConfigurations.cs
index dccc105c..c7f0a97f 100644
--- a/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/PrebuiltConfigurations.cs
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/PrebuiltConfigurations.cs
@@ -8,8 +8,7 @@ namespace Microsoft.Performance.SDK.Runtime.DTO.PreV1
{
[DataContract]
internal class PrebuiltConfigurations
- : PrebuiltConfigurationsBase,
- ISupportUpgrade
+ : PreviousPrebuiltConfigurationBase
{
internal static readonly double DTOVersion = 0.1;
@@ -21,9 +20,9 @@ public PrebuiltConfigurations()
[DataMember(Order = 2)]
public TableConfigurations[] Tables { get; set; }
- public DTO.PrebuiltConfigurations Upgrade()
+ protected override V1_0.PrebuiltConfigurations UpgradeToNext()
{
- return new DTO.PrebuiltConfigurations()
+ return new V1_0.PrebuiltConfigurations()
{
Tables = this.Tables.Select(configs => configs.Upgrade()).ToArray()
};
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/TableConfiguration.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/TableConfiguration.cs
index 895c7e26..c61951b2 100644
--- a/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/TableConfiguration.cs
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/TableConfiguration.cs
@@ -10,7 +10,7 @@ namespace Microsoft.Performance.SDK.Runtime.DTO.PreV1
{
[DataContract]
internal class TableConfiguration
- : ISupportUpgrade
+ : ISupportUpgrade
{
///
/// The table name.
@@ -100,7 +100,7 @@ internal class TableConfiguration
/// Columns that may appear in the table.
///
[DataMember(Order = 15)]
- public IEnumerable Columns { get; set; }
+ public IEnumerable Columns { get; set; }
///
/// The roles and their associated column entries.
@@ -108,7 +108,7 @@ internal class TableConfiguration
[DataMember(Order = 16)]
public IDictionary ColumnRoles { get; set; }
- public DTO.TableConfiguration Upgrade()
+ public V1_0.TableConfiguration Upgrade()
{
var newColumnRoles = new Dictionary(this.ColumnRoles.Count);
@@ -163,7 +163,7 @@ public DTO.TableConfiguration Upgrade()
}
}
- return new DTO.TableConfiguration()
+ return new V1_0.TableConfiguration()
{
Name = this.Name,
ChartType = this.ChartType,
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/TableConfigurations.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/TableConfigurations.cs
index 6e3af0cb..0a9c311b 100644
--- a/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/TableConfigurations.cs
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/PreV1/TableConfigurations.cs
@@ -9,7 +9,7 @@ namespace Microsoft.Performance.SDK.Runtime.DTO.PreV1
{
[DataContract]
internal class TableConfigurations
- : ISupportUpgrade
+ : ISupportUpgrade
{
[DataMember(Order = 1)]
public Guid TableId { get; set; }
@@ -20,9 +20,9 @@ internal class TableConfigurations
[DataMember(Order = 3)]
public TableConfiguration[] Configurations { get; set; }
- public DTO.TableConfigurations Upgrade()
+ public V1_0.TableConfigurations Upgrade()
{
- return new DTO.TableConfigurations()
+ return new V1_0.TableConfigurations()
{
TableId = this.TableId,
DefaultConfigurationName = this.DefaultConfigurationName,
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/PreviousPrebuiltConfigurationBase`1.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/PreviousPrebuiltConfigurationBase`1.cs
new file mode 100644
index 00000000..58355260
--- /dev/null
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/PreviousPrebuiltConfigurationBase`1.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace Microsoft.Performance.SDK.Runtime.DTO;
+
+[DataContract]
+internal abstract class PreviousPrebuiltConfigurationBase
+ : PrebuiltConfigurationsBase,
+ ISupportUpgrade
+ where TNext : PrebuiltConfigurationsBase
+{
+ public PrebuiltConfigurationsBase Upgrade()
+ {
+ var next = UpgradeToNext();
+ if (next.Version <= this.Version)
+ {
+ throw new InvalidOperationException(
+ $"Cannot upgrade to a version less than or equal to the current version. Current version: {this.Version}, Next version: {next.Version}");
+ }
+
+ return next;
+ }
+
+ ///
+ /// Upgrade the current configuration to the next version. The version number
+ /// of the returned configuration MUST be greater than this instance's version number.
+ ///
+ ///
+ /// The upgraded configuration.
+ ///
+ protected abstract TNext UpgradeToNext();
+}
\ No newline at end of file
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/TableConfigurationsSerializer.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/TableConfigurationsSerializer.cs
index f83be588..88e39154 100644
--- a/src/Microsoft.Performance.SDK.Runtime/DTO/TableConfigurationsSerializer.cs
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/TableConfigurationsSerializer.cs
@@ -9,6 +9,8 @@
using System.Runtime.Serialization.Json;
using System.Text;
using Microsoft.Performance.SDK.Processing;
+using Microsoft.Performance.SDK.Runtime.DTO.Latest;
+using TableConfigurations = Microsoft.Performance.SDK.Runtime.DTO.Latest.TableConfigurations;
namespace Microsoft.Performance.SDK.Runtime.DTO
{
@@ -27,6 +29,7 @@ public class TableConfigurationsSerializer
return assembly.GetTypes()
.Where(type => type.IsSubclassOf(typeof(PrebuiltConfigurationsBase)))
+ .Where(type => type.IsConcrete())
.Select(type => (((PrebuiltConfigurationsBase)Activator.CreateInstance(type)).Version, type)).ToArray();
});
@@ -94,15 +97,19 @@ public class TableConfigurationsSerializer
var desrailizedObject = serializer.ReadObject(stream);
- if (desrailizedObject is ISupportUpgrade supportUpgrade)
+ if (desrailizedObject is not PrebuiltConfigurationsBase configurationsBase)
{
- prebuiltConfigurations = supportUpgrade.Upgrade();
+ return Enumerable.Empty();
}
- else if (desrailizedObject is PrebuiltConfigurations latestConfigs)
+
+ while (configurationsBase is not PrebuiltConfigurations &&
+ configurationsBase is ISupportUpgrade upgradeable)
{
- prebuiltConfigurations = latestConfigs;
+ configurationsBase = upgradeable.Upgrade();
}
+ prebuiltConfigurations = configurationsBase as PrebuiltConfigurations;
+
if (prebuiltConfigurations == null)
{
return Enumerable.Empty();
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/ColumnConfiguration.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/ColumnConfiguration.cs
new file mode 100644
index 00000000..2ea679d4
--- /dev/null
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/ColumnConfiguration.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+using System.Runtime.Serialization;
+
+namespace Microsoft.Performance.SDK.Runtime.DTO.V1_0
+{
+ [DataContract]
+ internal class ColumnConfiguration
+ : ISupportUpgrade
+ {
+ ///
+ /// Metadata describing the column.
+ ///
+ [DataMember]
+ public ColumnMetadata Metadata { get; set; }
+
+ ///
+ /// UI hints for displaying the column.
+ ///
+ [DataMember]
+ public UIHints DisplayHints { get; set; }
+
+ public Latest.ColumnConfiguration Upgrade()
+ {
+ return new Latest.ColumnConfiguration()
+ {
+ Metadata = this.Metadata,
+ VariantGuid = null,
+ DisplayHints = this.DisplayHints,
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/PrebuiltConfigurations.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/PrebuiltConfigurations.cs
new file mode 100644
index 00000000..1d05a114
--- /dev/null
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/PrebuiltConfigurations.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+using System.Linq;
+using System.Runtime.Serialization;
+
+namespace Microsoft.Performance.SDK.Runtime.DTO.V1_0
+{
+ [DataContract]
+ internal class PrebuiltConfigurations
+ : PreviousPrebuiltConfigurationBase
+ {
+ internal static readonly double DTOVersion = 1.0;
+
+ public PrebuiltConfigurations()
+ {
+ this.Version = DTOVersion;
+ }
+
+ [DataMember(Order = 2)]
+ public TableConfigurations[] Tables { get; set; }
+
+ protected override Latest.PrebuiltConfigurations UpgradeToNext()
+ {
+ return new Latest.PrebuiltConfigurations()
+ {
+ Tables = this.Tables.Select(configs => configs.Upgrade()).ToArray()
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/TableConfiguration.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/TableConfiguration.cs
new file mode 100644
index 00000000..b114c747
--- /dev/null
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/TableConfiguration.cs
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using Microsoft.Performance.SDK.Runtime.DTO.Enums;
+
+namespace Microsoft.Performance.SDK.Runtime.DTO.V1_0
+{
+ [DataContract]
+ internal class TableConfiguration
+ : ISupportUpgrade
+ {
+ ///
+ /// The table name.
+ ///
+ [DataMember(Order = 1)]
+ public string Name { get; set; }
+
+ ///
+ /// The type of chart displayed for this table.
+ ///
+ [DataMember(Order = 2)]
+ public ChartType ChartType { get; set; }
+
+ ///
+ /// Gets or sets the aggregation over time mode for this table.
+ ///
+ [DataMember(Order = 3)]
+ public AggregationOverTime AggregationOverTime { get; set; }
+
+ ///
+ /// Gets or sets the query for initial filtering in this table.
+ ///
+ [DataMember(Order = 4)]
+ public string InitialFilterQuery { get; set; }
+
+ ///
+ /// Gets or sets the query for initial expansion in this table.
+ ///
+ [DataMember(Order = 5)]
+ public string InitialExpansionQuery { get; set; }
+
+ ///
+ /// Gets or sets the query for initial selection in this table.
+ ///
+ [DataMember(Order = 6)]
+ public string InitialSelectionQuery { get; set; }
+
+ ///
+ /// Get or sets whether the initial filter should be kept in this table.
+ ///
+ [DataMember(Order = 7)]
+ public bool InitialFilterShouldKeep { get; set; }
+
+ ///
+ /// Gets or sets the top value of the graph filter in this value.
+ ///
+ [DataMember(Order = 8)]
+ public int GraphFilterTopValue { get; set; }
+
+ ///
+ /// Gets or sets the threshold value of the graph filter in this table.
+ ///
+ [DataMember(Order = 9)]
+ public double GraphFilterThresholdValue { get; set; }
+
+ ///
+ /// Gets or sets the name of the column for graph filtering.
+ ///
+ [DataMember(Order = 10)]
+ public string GraphFilterColumnName { get; set; }
+
+ ///
+ /// Gets or sets the ID of the column for graph filtering.
+ ///
+ [DataMember(Order = 11)]
+ public Guid GraphFilterColumnGuid { get; set; }
+
+ ///
+ /// Gets or sets an string that is used for information about the table configuration.
+ ///
+ [DataMember(Order = 12)]
+ public string Description { get; set; }
+
+ ///
+ /// Gets or sets the collection of query entries that are used to highlight in this table.
+ ///
+ [DataMember(Order = 13)]
+ public IEnumerable HighlightEntries { get; set; }
+
+ ///
+ /// Columns that may appear in the table.
+ ///
+ [DataMember(Order = 14)]
+ public IEnumerable Columns { get; set; }
+
+ ///
+ /// The roles and their associated column entries.
+ ///
+ [DataMember(Order = 15)]
+ public IDictionary ColumnRoles { get; set; }
+
+ public Latest.TableConfiguration Upgrade()
+ {
+ return new Latest.TableConfiguration()
+ {
+ Name = this.Name,
+ ChartType = this.ChartType,
+ AggregationOverTime = this.AggregationOverTime,
+ InitialFilterQuery = this.InitialFilterQuery,
+ InitialExpansionQuery = this.InitialExpansionQuery,
+ InitialSelectionQuery = this.InitialSelectionQuery,
+ InitialFilterShouldKeep = this.InitialFilterShouldKeep,
+ GraphFilterTopValue = this.GraphFilterTopValue,
+ GraphFilterThresholdValue = this.GraphFilterThresholdValue,
+ GraphFilterColumnName = this.GraphFilterColumnName,
+ GraphFilterColumnGuid = this.GraphFilterColumnGuid,
+ Description = this.Description,
+ HighlightEntries = this.HighlightEntries,
+ Columns = this.Columns.Select(c => c.Upgrade()).ToArray(),
+ ColumnRoles = this.ColumnRoles
+ };
+ }
+ }
+}
diff --git a/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/TableConfigurations.cs b/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/TableConfigurations.cs
new file mode 100644
index 00000000..808f0ebf
--- /dev/null
+++ b/src/Microsoft.Performance.SDK.Runtime/DTO/V1_0/TableConfigurations.cs
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+using System;
+using System.Linq;
+using System.Runtime.Serialization;
+
+namespace Microsoft.Performance.SDK.Runtime.DTO.V1_0
+{
+ [DataContract]
+ internal class TableConfigurations
+ : ISupportUpgrade
+ {
+ [DataMember(Order = 1)]
+ public Guid TableId { get; set; }
+
+ [DataMember(Order = 2)]
+ public string DefaultConfigurationName { get; set; }
+
+ [DataMember(Order = 3)]
+ public TableConfiguration[] Configurations { get; set; }
+
+ public Latest.TableConfigurations Upgrade()
+ {
+ return new Latest.TableConfigurations()
+ {
+ TableId = this.TableId,
+ DefaultConfigurationName = this.DefaultConfigurationName,
+ Configurations = this.Configurations.Select(config => config.Upgrade()).ToArray()
+ };
+ }
+ }
+}
diff --git a/src/Microsoft.Performance.SDK/Processing/ColumnConfiguration.cs b/src/Microsoft.Performance.SDK/Processing/ColumnConfiguration.cs
index b9beee3e..9b280489 100644
--- a/src/Microsoft.Performance.SDK/Processing/ColumnConfiguration.cs
+++ b/src/Microsoft.Performance.SDK/Processing/ColumnConfiguration.cs
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
+using System;
+
namespace Microsoft.Performance.SDK.Processing
{
///
@@ -8,21 +10,6 @@ namespace Microsoft.Performance.SDK.Processing
///
public sealed class ColumnConfiguration
{
- ///
- /// Initializes a new instance of the
- /// class.
- ///
- ///
- /// The metadata about the column.
- ///
- ///
- /// is null.
- ///
- public ColumnConfiguration(ColumnMetadata metadata)
- : this(metadata, null)
- {
- }
-
///
/// Initializes a new instance of the
/// class.
@@ -35,14 +22,21 @@ public ColumnConfiguration(ColumnMetadata metadata)
/// may be null. If this parameter is null, then
/// will be used for this instance.
///
+ ///
+ /// Optional unique identifier of the column variant to use.
+ ///
///
/// is null.
///
- public ColumnConfiguration(ColumnMetadata metadata, UIHints hints)
+ public ColumnConfiguration(
+ ColumnMetadata metadata,
+ UIHints hints = null,
+ Guid? variantGuid = null)
{
Guard.NotNull(metadata, nameof(metadata));
this.Metadata = metadata;
+ this.VariantGuid = variantGuid;
this.DisplayHints = hints ?? UIHints.Default();
}
@@ -57,11 +51,11 @@ public ColumnConfiguration(ColumnMetadata metadata, UIHints hints)
/// is null.
///
public ColumnConfiguration(ColumnConfiguration other)
+ : this(
+ other.Metadata.CloneT(),
+ other.DisplayHints.CloneT(),
+ other.VariantGuid)
{
- Guard.NotNull(other, nameof(other));
-
- this.Metadata = other.Metadata.CloneT();
- this.DisplayHints = other.DisplayHints.CloneT();
}
///
@@ -69,6 +63,12 @@ public ColumnConfiguration(ColumnConfiguration other)
///
public ColumnMetadata Metadata { get; }
+ ///
+ /// Gets the unique identifier of the column variant to use.
+
+ ///
+ public Guid? VariantGuid { get; }
+
///
/// Gets any hints from the addin on how to render the column.
///
@@ -85,7 +85,14 @@ public ColumnConfiguration(ColumnConfiguration other)
///
public override string ToString()
{
- return $"{this.Metadata.Guid} - {this.Metadata.Name}";
+ if (this.VariantGuid == null)
+ {
+ return $"{this.Metadata.Guid} - {this.Metadata.Name}";
+ }
+ else
+ {
+ return $"{this.Metadata.Guid} - {this.Metadata.Name} (variant {this.VariantGuid})";
+ }
}
}
}
diff --git a/src/Microsoft.Performance.SDK/Processing/TableConfiguration.cs b/src/Microsoft.Performance.SDK/Processing/TableConfiguration.cs
index 66a5ee38..d9c1e53f 100644
--- a/src/Microsoft.Performance.SDK/Processing/TableConfiguration.cs
+++ b/src/Microsoft.Performance.SDK/Processing/TableConfiguration.cs
@@ -184,11 +184,15 @@ public IEnumerable Columns
/// Gets the mapping of column roles to column guids, if any.
/// If there are no column roles, then this dictionary will
/// be empty.
+ /// Only the base projection of a column can be assigned a role; variants
+ /// of a column cannot be assigned a role.
///
public IReadOnlyDictionary ColumnRoles { get; }
///
- /// Places the given column into the given column role.
+ /// Places the given column into the given column role. Only the base projection of
+ /// the column will be used; the set
+ /// on the configuration will be ignored.
///
///
/// The case sensitive role into which to place the column.
@@ -217,7 +221,8 @@ public void AddColumnRole(string columnRole, ColumnConfiguration column)
}
///
- /// Places the given column into the given column role.
+ /// Places the given column into the given column role. Only the base
+ /// projection of the specified column will be assigned to the role.
///
///
/// The case sensitive role into which to place the column.