Skip to content

Commit f9af8f9

Browse files
authored
Merge pull request #16 from microsoft/user/ivberg/Fix15_WPA_GE_FieldNamesValues
Fix LTTng GenericEvents not showing proper FieldNames or values
2 parents 4203219 + dade600 commit f9af8f9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

LTTngDataExtensions/Tables/GenericEventTable.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
111111
tableGenerator.AddColumn(countColumnConfig, Projection.Constant(1));
112112

113113
// Add the field columns, with column names depending on the given event
114-
for (int columnIndex = 0; columnIndex < maximumFieldCount; columnIndex++)
114+
for (int index = 0; index < maximumFieldCount; index++)
115115
{
116-
string fieldName = "Field " + (columnIndex + 1);
116+
var colIndex = index; // This seems unncessary but causes odd runtime behavior if not done this way. Compiler is confused perhaps because w/o this func will index=genericEvent.FieldNames.Count every time. index is passed as ref but colIndex as value into func
117+
string fieldName = "Field " + (colIndex + 1);
117118

118-
var genericEventFieldNameProjection = genericEventProjection.Compose((genericEvent) => columnIndex < genericEvent.FieldNames.Count ? genericEvent.FieldNames[columnIndex] : string.Empty);
119+
var genericEventFieldNameProjection = genericEventProjection.Compose((genericEvent) => colIndex < genericEvent.FieldNames.Count ? genericEvent.FieldNames[colIndex] : string.Empty);
119120

120121
// generate a column configuration
121122
var fieldColumnConfiguration = new ColumnConfiguration(
@@ -127,7 +128,7 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
127128
TextAlignment = TextAlignment.Left,
128129
});
129130

130-
var genericEventFieldAsStringProjection = genericEventProjection.Compose((genericEvent) => columnIndex < genericEvent.FieldNames.Count ? genericEvent.FieldValues[columnIndex] : string.Empty);
131+
var genericEventFieldAsStringProjection = genericEventProjection.Compose((genericEvent) => colIndex < genericEvent.FieldNames.Count ? genericEvent.FieldValues[colIndex] : string.Empty);
131132

132133
tableGenerator.AddColumn(fieldColumnConfiguration, genericEventFieldAsStringProjection);
133134
}

0 commit comments

Comments
 (0)