Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit ce32b41

Browse files
Fix file processing (#7)
* fix: file processing * chore: cleanup * chore: bump version number * chore: bump version number
1 parent 2d8a431 commit ce32b41

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

WPAPlugin/Properties/launchSettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"Debug": {
44
"commandName": "Executable",
55
"executablePath": "C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\wpa.exe",
6-
"commandLineArgs": "-nodefault -addsearchdir \"%USERPROFILE%\\devProjects\\wpa-plugin\\WPAPlugin\\bin\\Debug\\netstandard2.0\""
6+
"commandLineArgs": "-nodefault -addsearchdir \"%USERPROFILE%\\devProjects\\windowsperf-wpa-plugin\\WPAPlugin\\bin\\Debug\\netstandard2.0\""
77
},
88
"Release": {
99
"commandName": "Executable",
1010
"executablePath": "C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\wpa.exe",
11-
"commandLineArgs": "-nodefault -addsearchdir \"%USERPROFILE%\\devProjects\\wpa-plugin\\WPAPlugin\\bin\\Release\\netstandard2.0\""
11+
"commandLineArgs": "-nodefault -addsearchdir \"%USERPROFILE%\\devProjects\\windowsperf-wpa-plugin\\WPAPlugin\\bin\\Release\\netstandard2.0\""
1212
}
1313
}
1414
}

WPAPlugin/WPAPlugin.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<AssemblyVersion>1.0.2</AssemblyVersion>
6-
<FileVersion>1.0.2</FileVersion>
7-
<Version>1.0.2</Version>
5+
<AssemblyVersion>1.0.3</AssemblyVersion>
6+
<FileVersion>1.0.3</FileVersion>
7+
<Version>1.0.3</Version>
88
</PropertyGroup>
99

1010
<ItemGroup>

WPAPlugin/WperfProcessingSourceWithSourceParser.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
using System.Collections.Generic;
3333
using System.IO;
34-
using System.Linq;
3534
using Microsoft.Performance.SDK.Processing;
3635
using NJsonSchema;
3736
using WPAPlugin.Schemas;
@@ -51,6 +50,9 @@ public class WperfProcessingSourceWithSourceParser : ProcessingSource
5150
{
5251
private IApplicationEnvironment applicationEnvironment;
5352

53+
public WperfProcessingSourceWithSourceParser()
54+
: base() { }
55+
5456
/// <summary>
5557
/// Sets project information
5658
/// </summary>
@@ -92,13 +94,8 @@ protected override ICustomDataProcessor CreateProcessorCore(
9294
ProcessorOptions options
9395
)
9496
{
95-
WperfSourceParser parser = new WperfSourceParser(
96-
timelinePathList.ToArray(),
97-
countingPathList.ToArray()
98-
);
97+
WperfSourceParser parser = new WperfSourceParser(timelinePathList, countingPathList);
9998

100-
timelinePathList.Clear();
101-
countingPathList.Clear();
10299
validationCache.Clear();
103100
return new WperfCustomDataProcessorWithSourceParser(
104101
parser,

WPAPlugin/WperfSourceParser.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,18 @@ namespace WPAPlugin
4747
/// </summary>
4848
public class WperfSourceParser : ISourceParser<WperfEvent, WperfSourceParser, string>
4949
{
50-
private readonly string[] timelineFilesPathList;
51-
private readonly string[] countFilesPathList;
50+
private readonly HashSet<string> timelineFilesPathList;
51+
private readonly HashSet<string> countFilesPathList;
5252

5353
/// <summary>
5454
/// Timeline and count files paths lists need to be passed seperately to the <c>constructor</c>
5555
/// </summary>
5656
/// <param name="timelineFilesPathList">List of timeline file paths</param>
5757
/// <param name="countFilesPathList">List of single count file paths</param>
58-
public WperfSourceParser(string[] timelineFilesPathList, string[] countFilesPathList)
58+
public WperfSourceParser(
59+
HashSet<string> timelineFilesPathList,
60+
HashSet<string> countFilesPathList
61+
)
5962
{
6063
this.timelineFilesPathList = timelineFilesPathList;
6164
this.countFilesPathList = countFilesPathList;
@@ -96,7 +99,7 @@ private void ProcessTimelineFiles(
9699
CancellationToken cancellationToken
97100
)
98101
{
99-
int filesCount = timelineFilesPathList.Length;
102+
int filesCount = timelineFilesPathList.Count;
100103
if (filesCount == 0)
101104
{
102105
return;
@@ -211,7 +214,7 @@ private void ProcessCountFiles(
211214
CancellationToken cancellationToken
212215
)
213216
{
214-
int filesCount = countFilesPathList.Length;
217+
int filesCount = countFilesPathList.Count;
215218
if (filesCount == 0)
216219
{
217220
return;
@@ -312,6 +315,8 @@ CancellationToken cancellationToken
312315
{
313316
ProcessTimelineFiles(dataProcessor, cancellationToken);
314317
ProcessCountFiles(dataProcessor, cancellationToken);
318+
this.timelineFilesPathList.Clear();
319+
this.countFilesPathList.Clear();
315320
}
316321
}
317322
}

0 commit comments

Comments
 (0)