Coder Social home page Coder Social logo

pal's People

Contributors

clinthuffman avatar koenzomers avatar ktaranov avatar vonogre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pal's Issues

can not execute a scheduled task to auto generate a HTML report from captured perfmon data

Hello Everyone, from the "Queue" tab in the PAL wizard I am able to manually execute that code to generate the HTML report. However, no matter what I have tried to setup a scheduled task to auto generate this report, the job fails. help! is this possible? I would like to setup a scheduled tasks to run nightly to automatically crunch the data from perfmon and auto create a HTML report in a directory I have shared.

Have a good day

Thanks for all the work you've done on this tool sir. Really.

Appreciate it.

image

Test-Property : The term 'Test-Property' is not recognized as the name of a cmdlet, function, script file, or operable

Hi,

I am getting this error on Win10 x64 PS 5.1, do I need admin rights to run PAL?

Test-Property : The term 'Test-Property' is not recognized as the name of a cmdlet, function, script file, or operable

program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At C:\Users\xxxx\Documents\WindowsPowerShell\PAL.ps1:157 char:11

  • If ($(Test-Property -InputObject $Error[0] -Name 'CommandInvocati ...
    
  •       ~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Test-Property:String) [], CommandNotFoundException

    • FullyQualifiedErrorId : CommandNotFoundException

Thanks

The property 'CounterObject' cannot be found on this object. Verify that the property exists.

Overall progress... Status: Generating analysis counters, PAL 2.8.1 Progress: 71%... Generating analysis counters, SQLServer:Access Methods Forwarded Records/sec

An error occurred on...
$sSqlInstanceNameForSQLServerAccessMethodsForwardedRecordssec = ExtractSqlNamedInstanceFromCounterObjectPath -sCounterObjectPath $htVariables["CollectionOfSQLServerAccessMethodsForwardedRecordssec"][$a].CounterObject
At line:5 char:13 + $sSqlInstanceNameForSQLServerAccessMethodsForwardedRecordssec = Extr ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The property 'CounterObject' cannot be found on this object. Verify that the property exists.

SCRIPT ARGUMENTS:
Log: C:\TEMP\PALCapture\PAL_Microsoft_SQL_Server_2012.blg
ThresholdFile: C:\Program Files\PAL\PAL\SQLServer2012.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: [My Documents]\PAL Reports
AllCounterStats: $False
NumberOfThreads: 4
IsLowPriority: $False
DisplayReport: True

Standard Deviations and Outliers Removed

I am evaluating the Physical Disk Avg. Disk sec / Write counter. Performance Monitor says the average is .065 but PAL says .028 under overall counter instance statistics. Min / Max are the same between the two tools.

I've never considered precisely what the Standard Deviations and Outliers Removed (10, 20, 30% etc.) mean. What do they mean and how do I "reconcile" them when interpreting the results?

Thanks!

Property 'CounterComputer' cannot be found on this object. Make sure that it exists.

Log generated on Windows 2012 / BizTalk 2013, standard PAL BizTalk template used in Performance Monitor

Overall progress... Status: Generating analysis counters, PAL 2.7.7 Progress: 71%... Generating analysis counters, BizTalk Orchestrations Resident in Memory

An error occurred on...
$sInstanceNameForXLANGsOrchestrationsDehydratableorchestrationsALLWithComputer = "$($htVariables["CollectionOfXLANGsOrchestrationsDehydratableorchestrationsALL"][$a].CounterComputer)" + '/' + "$($htVariables["CollectionOfXLANGsOrchestrationsDehydratableorchestrationsALL"][$a].CounterInstance)"
At line:10 char:99 + $sInstanceNameForXLANGsOrchestrationsDehydratableorchestrationsALL ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Property 'CounterComputer' cannot be found on this object. Make sure that it exists.

SCRIPT ARGUMENTS:
Log: ---_20170605-000002\PAL_Microsoft_BizTalk_Server_2006_2009_2010.blg
ThresholdFile: ---\BizTalkServer2006.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: [My Documents]\PAL Reports
AllCounterStats: $False
NumberOfThreads: 4
IsLowPriority: $True
DisplayReport: True

2.7.7: Analysis interval is ignored

Whether I set the interval to 30 minutes, 60 minutes or leave it a Auto the interval used/displayed is ~45 minutes
24 hours log data

Ahh the parameter is not set, from the PAL.log:

Name Value


AllCounterStats False
AnalysisInterval AUTO
BeginTime
DisplayReport True

PAL for SQL 2017

Hi Clint,
Is there a plan to include SQL 2016 and SQL 2017 anytime soon? Really love this tool and hoping it will have one for the latest SQL Server.

Thanks much.

processing BLG files takes way too long

Even with max cores used, normal priority, I've been parsing 2 days of a server "System Overview" blg since this morning and I'm about half-way done. Is it more efficient to load parsing in multiple VMs (on the same host) or even just run PAL multiple times with the same resources being shared? I have 24 GB of RAM and a Ryzen 1700x and I'm parsing PAL BLGs at about 8% util.

Error: Progress: 12%... InheritFromThresholdFiles

@clinthuffman getting an error. Reproduced using the SamplePerfmonLog file you include in setup package. Works in 2.7.7 but bombs after copy / pasting in files from the PAL_FlatFiles_2.7.7.1_x64 zip that I found uploaded to here about 10 days ago.

Error processing "C:\Program Files\PAL\PAL\SamplePerfmonLog.blg"

Report Generated at: 2018.09.07-13:17:14 PALv2

Overall progress... Status: InheritFromThresholdFiles, PAL 2.7.7 Progress: 12%... InheritFromThresholdFiles,

An error occurred on...
if(-not ([string]::IsNullOrWhiteSpace($inheritedXml))){
At C:\Program Files\PAL\PAL\PAL.ps1:910 char:40 + if(-not ([string]::IsNullOrWhiteSpace <<<< ($inheritedXml))){
Method invocation failed because [System.String] doesn't contain a method named 'IsNullOrWhiteSpace'.
PAL-131808142343208255-0.log

0 Kb reports being generated for BizTalk

PAL is consistently generating 0 Kb report files for BizTalk. All the charts have been generated in the charts folder however the html report is 0 kb. I have reverted to an old version of PAL for my BizTalk blg files which does work correctly. Any chance of getting this fixed for the new version?

Cannot call a method on a null-valued expression

Overall progress... Status: Creating charts, PAL 2.8.2 Progress: 76.4705882352941%... Creating charts, PhysicalDisk Write Latency Analysis

An error occurred on...
For ($i=0;$i -le $iValues.GetUpperBound(0);$i++)
At C:\Program Files\PAL\PAL\PAL.ps1:3041 char:15 + For ($i=0;$i -le $iValues.GetUpperBound(0);$i++) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You cannot call a method on a null-valued expression.

SCRIPT ARGUMENTS:
Log: C:\PerfLogs\20181207\DCX\SPW-MDY-020\18H00-19H30\PAL_System_Overview.blg
ThresholdFile: C:\Program Files\PAL\PAL\SystemOverview.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: C:\PerfLogs\20181207\DCX\SPW-MDY-020\18H00-19H30\PAL Reports
AllCounterStats: $False
NumberOfThreads: 4
IsLowPriority: $True
DisplayReport: True

The property 'Computer' cannot be found on this object. Verify that the property exists.

Tried running a file with some simple counters and get the below error.
Strangely I also get this when running the sample file included in the PAL msi

An error occurred on...
$sCounterComputer = $oCtr.Computer
At C:\Program Files\PAL\PAL\PAL.ps1:1488 char:6 + $sCounterComputer = $oCtr.Computer + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The property 'Computer' cannot be found on this object. Verify that the property exists.

Unexpected token 'Total[$i]' in expression or statement

Hi, I encounter this error when checking some Exchange server performance logs:
Overall progress... Status: Applying thresholds, PAL 2.8.1 Progress: 82%... Applying thresholds, Client Access - LogicalDisk Disk Reads/sec

An error occurred on...
Invoke-Expression -Command $sCode
At C:\Program Files\PAL\PAL\PAL.ps1:4536 char:9 + Invoke-Expression -Command $sCode + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At line:5 char:80 + ... rites = $htVariables["CollectionOfLogicalDiskDiskWritessec"]Total[$i] + ~~~~~~~~~ Unexpected token 'Total[$i]' in expression or statement.

This happened more than once.
I used autodetect for the threshold files:

I cannot find any log file in %temp% folder or in Pal folder, do I need to activate some logging in the config file?

PAL doesn't add data for Process/Working Set Private to the htm report

Hello Clint,

I encounter a problem that PAL doesn't generate data for Process/Working Set Private counter in htm report. When my Performance Counter contains many counters it looks like PAL just ignore Process/Working Set Private and generate the report without it.
I created empty Performance Counter NewDataCollector, added only Process/Working Set Private there and I got such error message:

Overall progress... Status: Calculating counter statistics [very CPU intensive]..., PAL 2.8.1 Progress: 65%... Calculating counter statistics [very CPU intensive]...,

An error occurred on...
$iPercentComplete = ConvertToDataType $(($iIndexOfJobs / $iTotalJobs) * 100) 'integer'
At C:\Program Files\PAL\PAL\PAL.ps1:2526 char:49 + ... ete = ConvertToDataType $(($iIndexOfJobs / $iTotalJobs) * 100) 'integ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Attempted to divide by zero.

SCRIPT ARGUMENTS:
Log: C:\PerfLogs\Admin\NewDataCollector\BLACKBIRD_20190204-000001\DataCollector01.blg
ThresholdFile: C:\Program Files\PAL\PAL\SystemOverview.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: D:\PAL_results\IDLE_new_test
AllCounterStats: $False
NumberOfThreads: 4
IsLowPriority: $True
DisplayReport: True

However, Working Set Private exists in the .blg file.

I use PAL v2.8.1 on Windows 10 64-bit.

Divide by zero

Overall progress... Status: Calculating counter statistics [very CPU intensive]..., PAL 2.7.7 Progress: 65%... Calculating counter statistics [very CPU intensive]...,

An error occurred on...
$iPercentComplete = ConvertToDataType $(($iIndexOfJobs / $iTotalJobs) * 100) 'integer'
At C:\PerfLogs\PAL_FlatFiles_2.7.7_x64\PAL.ps1:2293 char:49 + ... ete = ConvertToDataType $(($iIndexOfJobs / $iTotalJobs) * 100) 'integ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Attempted to divide by zero.

SCRIPT ARGUMENTS:
Log: C:\PerfLogs\551 System Monitor Log.blg
ThresholdFile: C:\Users\user\AppData\Local\Temp\PalAutoDetectThresholdFile_95451b8a-be52-4b0e-a86a-51502b9f8bcb.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: [My Documents]\PAL Reports
AllCounterStats: $True
NumberOfThreads: 4
IsLowPriority: $True
DisplayReport: True

Processing Multiple Exchange BLG files

Hi-
I'm running PAL 2.7.7 (got it from CodePlex). When I try to run multiple files through PAL, it seems to crash out. What am I doing wrong?

PAL.log shows:


Windows PowerShell transcript start
Start time: 20170517075342
Username: domain\me
RunAs User: domain\me
Machine: 121100 (Microsoft Windows NT 10.0.14393.0)
Host Application: Powershell -ExecutionPolicy ByPass -NoProfile -File .\PAL.ps1 -Log C:\USEIMAIL1303\USEIMAIL13031.blg;C:\USEIMAIL1303\USEIMAIL13032.blg -ThresholdFile C:\Program Files\PAL\PAL\Exchange2013.xml -Interval AUTO -IsOutputHtml $True -HtmlOutputFileName [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm -IsOutputXml $False -XmlOutputFileName [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml -AllCounterStats $False -NumberOfThreads 4 -IsLowPriority $True -OS 64-bit Windows Server 2012 -PhysicalMemory 64 -UserVa 2048
Process ID: 7728
PSVersion: 5.1.14393.953
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.14393.953
BuildVersion: 10.0.14393.953
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1


Transcript started, output file is C:\Users\me\AppData\Local\Temp\PAL.log
PAL 2.7.7 (http://pal.codeplex.com)
Written by: Clint Huffman ([email protected]) and other contributors.
Last Modified: 10/27/2016 16:57:48
The information and actions by this tool is provided "as is" and is intended for information purposes only. The authors and contributors of this tool take no responsibility for damages or losses incurred by use of this tool.
Your locale is set to: English (United States)
SCRIPT ARGUMENTS:

Name Value


AllCounterStats False
AnalysisInterval AUTO
BeginTime
DisplayReport True
EndTime
HtmlOutputFileName [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
Interval AUTO
IsLowPriority True
IsOutputHtml True
IsOutputXml False
Log C:\MAIL1303\MAIL13031.blg;C:\MAIL1303\MAIL13032.blg
NumberOfThreads 4
OS 64-bit Windows Server 2012
OutputDir [My Documents]\PAL Reports
PhysicalMemory 64
ThresholdFile C:\Program Files\PAL\PAL\Exchange2013.xml
UserVa 2048
XmlOutputFileName [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml

Creating session working directory...
Creating directory "C:\Users\me\AppData\Local\Temp\6ed36dc0-7bfc-42c4-8b91-63ecc361862a"
Creating file "C:\Users\me\Documents\PAL Reports\MAIL13031_PAL_ANALYSIS_20170517075342.htm"
Creating directory "C:\Users\me\Documents\PAL Reports\MAIL13031_PAL_ANALYSIS_20170517075342"

Threshold File Load History (in order of priority):
C:\Program Files\PAL\PAL\Exchange2013.xml
SystemOverview.xml
QuickSystemOverview.xml

Generating the counter list to filter on...
Done
Removing duplicate counter expressions from counter list...
Done

PS>TerminatingError(): "The property 'CounterListFilePath' cannot be found on this object. Verify that the property exists."

TerminatingError(): "The property 'CounterListFilePath' cannot be found on this object. Verify that the property exists."
The property 'CounterListFilePath' cannot be found on this object. Verify that the property exists.
At C:\Program Files\PAL\PAL\PAL.ps1:1143 char:76

  • ... "" + ' -cf ' + ""$($global:oPal.Session.CounterListFilePath)`"" + ' ...
  •                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
    • FullyQualifiedErrorId : PropertyNotFoundStrict
      The property 'CounterListFilePath' cannot be found on this object. Verify that the property exists.
      At C:\Program Files\PAL\PAL\PAL.ps1:1143 char:76
  • ... "" + ' -cf ' + ""$($global:oPal.Session.CounterListFilePath)`"" + ' ...
  •                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
    • FullyQualifiedErrorId : PropertyNotFoundStrict

Get-Content : Cannot find path
'C:\Users\me\AppData\Local\Temp\6ed36dc0-7bfc-42c4-8b91-63ecc361862a_FilteredPerfmonLog.csv' because it does not
exist.
At C:\Program Files\PAL\PAL\PAL.ps1:1907 char:14

  • $oCSVFile = Get-Content $CsvFilePath
    
  •             ~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (C:\Users\kbruss...dPerfmonLog.csv:String) [Get-Content],
      ItemNotFoundException
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
      Get-Content : Cannot find path
      'C:\Users\me\AppData\Local\Temp\6ed36dc0-7bfc-42c4-8b91-63ecc361862a_FilteredPerfmonLog.csv' because it does
      not exist.
      At C:\Program Files\PAL\PAL\PAL.ps1:1907 char:14
  • $oCSVFile = Get-Content $CsvFilePath
    
  •             ~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (C:\Users\kbruss...dPerfmonLog.csv:String) [Get-Content], ItemNotFoundEx
      ception
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

PS>TerminatingError(): "Cannot index into a null array."

TerminatingError(): "Cannot index into a null array."
Cannot index into a null array.
At C:\Program Files\PAL\PAL\PAL.ps1:1908 char:2

  • $aRawCounterList = $oCSVFile[0].Split(",")
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
      Cannot index into a null array.
      At C:\Program Files\PAL\PAL\PAL.ps1:1908 char:2
  • $aRawCounterList = $oCSVFile[0].Split(",")
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray

Auto analysis interval (one time only)...
PS>TerminatingError(): "Cannot convert null to type "System.DateTime"."

TerminatingError(): "Cannot convert null to type "System.DateTime"."
Cannot convert null to type "System.DateTime".
At C:\Program Files\PAL\PAL\PAL.ps1:1929 char:9

  •     [datetime] $dtBeginDateTime = $dtBeginDateTime
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : MetadataError: (:) [], ArgumentTransformationMetadataException
    • FullyQualifiedErrorId : RuntimeException
      Cannot convert null to type "System.DateTime".
      At C:\Program Files\PAL\PAL\PAL.ps1:1929 char:9
  •     [datetime] $dtBeginDateTime = $dtBeginDateTime
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : MetadataError: (:) [], ArgumentTransformationMetadataException
    • FullyQualifiedErrorId : RuntimeException

Number Of Counter Instances In Perfmon Log: 0

Quantized index (one time only)...
PS>TerminatingError(): "Cannot convert null to type "System.DateTime"."
Cannot convert null to type "System.DateTime".
At C:\Program Files\PAL\PAL\PAL.ps1:2324 char:2

  • [datetime] $dTimeCursor = [datetime] $ArrayOfTimes[0]
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [], RuntimeException
    • FullyQualifiedErrorId : nullToObjectInvalidCast
      Cannot convert null to type "System.DateTime".
      At C:\Program Files\PAL\PAL\PAL.ps1:2324 char:2
  • [datetime] $dTimeCursor = [datetime] $ArrayOfTimes[0]
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [], RuntimeException
    • FullyQualifiedErrorId : nullToObjectInvalidCast

Matching counter instances to threshold data sources...
Done [1.058 seconds]
Calculating counter statistics [very CPU intensive]...
Number of jobs passed into Thread(0): 0
Number of jobs passed into Thread(1): 0
Number of jobs passed into Thread(2): 0
Number of jobs passed into Thread(3): 0
PS>TerminatingError(): "Attempted to divide by zero."
Attempted to divide by zero.
At C:\Program Files\PAL\PAL\PAL.ps1:2293 char:49

  • ... ete = ConvertToDataType $(($iIndexOfJobs / $iTotalJobs) * 100) 'integ ...
  •                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], RuntimeException
    • FullyQualifiedErrorId : RuntimeException
      Attempted to divide by zero.
      At C:\Program Files\PAL\PAL\PAL.ps1:2293 char:49
  • ... ete = ConvertToDataType $(($iIndexOfJobs / $iTotalJobs) * 100) 'integ ...
  •                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], RuntimeException
    • FullyQualifiedErrorId : RuntimeException

Creating generated counter data [This is PAL working with multiple counters to produce a single result]...
Creating generated counter data... Done! [1.469 seconds]
Generating Charts...
Processing Thresholds...
Generating the HTML Report...
PS>TerminatingError(): "Cannot convert null to type "System.DateTime"."

TerminatingError(): "Cannot convert null to type "System.DateTime"."
Cannot convert null to type "System.DateTime".
At C:\Program Files\PAL\PAL\PAL.ps1:4502 char:25

  • $Date1 = Get-Date $([datetime]$global:oPal.aTime[0]) -format $glo ...
    
  •                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [], RuntimeException
    • FullyQualifiedErrorId : nullToObjectInvalidCast
      Cannot convert null to type "System.DateTime".
      At C:\Program Files\PAL\PAL\PAL.ps1:4502 char:25
  • $Date1 = Get-Date $([datetime]$global:oPal.aTime[0]) -format $glo ...
    
  •                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [], RuntimeException
    • FullyQualifiedErrorId : nullToObjectInvalidCast

C:\Users\me\Documents\PAL Reports\MAIL13031_PAL_ANALYSIS_20170517075342.htm


Windows PowerShell transcript end
End time: 20170517075420


Cannot pick instance of counter for analysis

The goal is to establish thresholds and baselines for various processes inside the corporation and run them through PAL so that during testing if they exceed the baseline PAL generates warning. So for example, I want to collect Process/%ProcessorTime(Outlook) and establish a threshold of 10% CPU time, (not inclusive of number of processors - I looked at that code and I can duplicate it, but I cannot get this to run at all)

I use the following code in the threshold:

#// Use PowerShell code to create alerts when the conditions for this threshold are met.
#// Optionally use the variables listed above in the Variables list box.
#// If the condition for this threshold is a static value, then use the StaticThreshold() function.
#// Otherwise, you will need to manually loop through the counter instance collection object.
#// The counter instance collection object has a unique name for each counter data source in this analysis.
#// See the variables in the Variables list box above for more information on the counter instance collection object.

#// Here is a ready to use example on how to use the StaticThreshold() function to define a threshold:
StaticThreshold -CollectionOfCounterInstances $CollectionOfOutlookProcessPercentProcessorTime -Operator 'gt' -Threshold 10

#// The -Operator parameter accepts gt for greater than, ge for greater than or equal to, lt for less than,
#// and le for less than or equal to. -Threshold is the static value for the threshold.

This crashes with

Overall progress... Status: Calculating counter statistics [very CPU intensive]..., PAL 2.7.7 Progress: 65%... Calculating counter statistics [very CPU intensive]..., Process Outlook % Processor Time



An error occurred on...
If (@($XmlAnalysis.DATASOURCE).Count -gt 1)

At C:\Program Files\PAL\PAL\PAL.ps1:1969 char:13

  •     If (@($XmlAnalysis.DATASOURCE).Count -gt 1)
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR>The property 'DATASOURCE' cannot be found on this object. Verify that the property exists.<BR>
    

Can not convert value during data processing

Recreating: converting a 60 mins perfmon file with multiple system and SQL counters using the all threashold File title on Pal v2.7.7

when it started processing Edge Transport - physical Disk avg.disk sec/reads the error was thrown

Invoke-Expression : Could not compare "0" to "0.02". Error: "Cannot convert value "0.02" to type "System.Char". Error:
"Invalid cast from 'Double' to 'Char'.""
At C:\Program Files\PAL\PAL\PAL.ps1:4337 char:9

  •     Invoke-Expression -Command $sCode
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Invoke-Expression], RuntimeException
    • FullyQualifiedErrorId : ComparisonFailure,Microsoft.PowerShell.Commands.InvokeExpressionCommand

From the HTML Report:

Overall progress... Status: Applying thresholds, PAL 2.7.7 Progress: 82%... Applying thresholds, Edge Transport - PhysicalDisk Avg. Disk sec/Read

An error occurred on...
If ($oCounterInstance.QuantizedAvg[$t] -ge 0.02)
At line:11 char:7 + If ($oCounterInstance.QuantizedAvg[$t] -ge 0.02) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Could not compare "0" to "0.02". Error: "Cannot convert value "0.02" to type "System.Char". Error: "Invalid cast from 'Double' to 'Char'.""

SCRIPT ARGUMENTS:
Log: C:\Users\mark.jones\Documents\ledw_etl\DBEDWSTGP1_DataCollector01.blg
ThresholdFile: C:\Program Files\PAL\PAL\All.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: C:\Users\mark.jones\Documents\ledw_etl\preissue
AllCounterStats: $False
NumberOfThreads: 4
IsLowPriority: $True
DisplayReport: True

Please contact the PAL tool team with this error by posting it to pal.codeplex.com. Thank you!

from the pal log

Edge Transport - PhysicalDisk Avg. Disk sec/Read
PS>TerminatingError(Invoke-Expression): "Could not compare "0" to "0.02". Error: "Cannot convert value "0.02" to type "System.Char". Error: "Invalid cast from 'Double' to 'Char'."""

TerminatingError(Invoke-Expression): "Could not compare "0" to "0.02". Error: "Cannot convert value "0.02" to type "System.Char". Error: "Invalid cast from 'Double' to 'Char'."""
TerminatingError(Invoke-Expression): "Could not compare "0" to "0.02". Error: "Cannot convert value "0.02" to type "System.Char". Error: "Invalid cast from 'Double' to 'Char'."""
TerminatingError(Invoke-Expression): "Could not compare "0" to "0.02". Error: "Cannot convert value "0.02" to type "System.Char". Error: "Invalid cast from 'Double' to 'Char'."""
Invoke-Expression : Could not compare "0" to "0.02". Error: "Cannot convert value "0.02" to type "System.Char". Error:
"Invalid cast from 'Double' to 'Char'.""
At C:\Program Files\PAL\PAL\PAL.ps1:4337 char:9

  •     Invoke-Expression -Command $sCode
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Invoke-Expression], RuntimeException
    • FullyQualifiedErrorId : ComparisonFailure,Microsoft.PowerShell.Commands.InvokeExpressionCommand
      Invoke-Expression : Could not compare "0" to "0.02". Error: "Cannot convert value "0.02" to type "System.Char". Error:
      "Invalid cast from 'Double' to 'Char'.""
      At C:\Program Files\PAL\PAL\PAL.ps1:4337 char:9
  •     Invoke-Expression -Command $sCode
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Invoke-Expression], RuntimeException
    • FullyQualifiedErrorId : ComparisonFailure,Microsoft.PowerShell.Commands.InvokeExpressionCommand

Generating the HTML Report...

How do I handle data integrity wrt Time field?

Let us suppose someone relogged a blg file and in an effort to remove PII, mangled the date field. Is there a way to just tell PAL to process "from 0 time to end of time" since in the BLG/csv it does increment the hour value?

Unhandled exception: Conversion from string "2018 6:00:01" to type 'Date' is not valid

The log that caused this is 230MB.
But here's the exception dialog text.

Cheers,
NIck.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidCastException: Conversion from string "2018 6:00:01" to type 'Date' is not valid.
at Microsoft.VisualBasic.CompilerServices.Conversions.ToDate(String Value)
at PALWizard.frmPALExecutionWizard.GetCounterLogInformation(Object sCounterLogFilePath)
at PALWizard.frmPALExecutionWizard.UpdateCheckBoxRestrictToDateTimeRange()
at PALWizard.frmPALExecutionWizard.CheckBoxRestrictToADateTimeRange_CheckedChanged(Object sender, EventArgs e)
at System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e)
at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
at System.Windows.Forms.CheckBox.OnClick(EventArgs e)
at System.Windows.Forms.CheckBox.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll

PALWizard
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///C:/Program%20Files/PAL/PAL/PALWizard.exe

Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll

System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8827 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll

PALFunctions
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/PAL/PAL/PALFunctions.DLL

System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_64/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

[MergeConvertFilterPerfmonLogs] ERROR: Unable to find the converted log file

Hi,

I am unable to generate the HTML Report. Amy suggestion?

[MergeConvertFilterPerfmonLogs] ERROR: Unable to find the converted log file: C:\Users..\AppData\Local\Temp\78480824-0f57-4089-84a0-238af1e341ef_FilteredPerfmonLog.csv. Relog.exe failed to process the log. Review the results above this line. If relog.exe continues to fail, then try running Relog.exe manually and/or contact Microsoft Customer Support Servers for support on Relog.exe only. PAL is not supported by Microsoft.

SCRIPT ARGUMENTS:
Log: ....\DataCollector0130310201805.blg
ThresholdFile: C:\Program Files\PAL\PAL\SystemOverview.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: [My Documents]\PAL Reports
AllCounterStats: $False
NumberOfThreads: 2
IsLowPriority: $True
DisplayReport: True

Upcoming Feature: Non-English Counter Log Analysis

Please let me know if there is a high demand for any language that I do not have listed below. Be aware that the effort to do the translation is very time consuming, but so far highly accurate.

Its been a very long time coming to this, but proud to announce that I am actively working on counter log language translation for PAL. This is part of a longer localization effort. For clarification, this is a feature that will be able the PAL tool to analyze performance counter logs recorded in non-English languages (only English is supported at this time) and then produce an HTML report in English. Eventually, I would like to have the HTML reports localized. So far, I plan to only support language translation for all of the Windows Server 2016 performance counters which should cover the majority if not all of the OS counters.

Also, while doing this, I am noticing some OS bugs where not all of the OS counters exposed to every language. I am filing bugs with the Windows team as I do this.

Here are the following languages I plan to have counter log translation for. Please let me know if you have a request to support a language not listed here:
Chinese
Czech (Czech Republic)
Dutch (Netherlands)
English (United States)
French (France)
German (Germany)
Hungarian (Hungary)
Italian (Italy)
Japanese (Japan)
Korean (Korea)
Polish (Poland)
Portuguese (Brazil)
Portuguese (Portugal)
Russian (Russia)
Spanish (Spain)
Swedish (Sweden)
Turkish (Turkey)

Also, most of the Asian languages (and Russian) such as, but not limited to Japanese do not have a translation - meaning the English counter names are used when using a Japanese language pack.

Question about PAL tool.

I'm trying the PAL tool for the first time and it works great. I'm looking in the .html document and see this pc - zach-pc Is this just the pc that was the counters were created on? Or can you enter the pc name in the program? Also, is there a Windows 10 version coming?

The Windows Performance Analysis Field Guide is a fantastic book. Thank you.

Error Processing .blg

Overall progress... Status: Preparing counter log(s), PAL 2.8.2 Progress: 24%... Preparing counter log(s),

[MergeConvertFilterPerfmonLogs] ERROR: Unable to find the converted log file: D:\Users\jhankins\AppData\Local\Temp\c0c81d1a-aee3-495f-b02b-ead3bf89983c_FilteredPerfmonLog.csv. Relog.exe failed to process the log. Review the results above this line. If relog.exe continues to fail, then try running Relog.exe manually and/or contact Microsoft Customer Support Servers for support on Relog.exe only. PAL is not supported by Microsoft.
Attempting to process log gathered from Windows Server 2016 Datacenter

SCRIPT ARGUMENTS:
Log: \dc2\c$\PerfLogs\dc2_000001.blg
ThresholdFile: D:\Users\jhankins\AppData\Local\Temp\PalAutoDetectThresholdFile_02abfcff-606e-43a8-90d9-ec35d0c412ce.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: [My Documents]\PAL Reports
AllCounterStats: $False
NumberOfThreads: 4
IsLowPriority: $True
DisplayReport: True

PAL automation

Hi Clint,

Is there a way to automate PAL through the command line or in some other way?

Thank you

An error occurred on... relog.exe

Hi,
Help please
I'm getting the fowlloing error

Overall progress... Status: Preparing counter log(s), PAL 2.8.2 Progress: 24%... Preparing counter log(s),

An error occurred on...
relog.exe "C:\Users\Jantero\Desktop\Autitoria_PAN&Past_SQL2012\PAN&past_PAL_Microsoft_SQL_Server_2012.blg" -f csv -o "C:\Users\Jantero\AppData\Local\Temp\b81f8f44-f876-4578-beea-cac447330f4c_FilteredPerfmonLog.csv" -y
At line:1 char:1 + relog.exe "C:\Users\Jantero\Desktop\Autitoria_PAN&Past_SQL2012\PAN&pa ... + ~~~~~~~~~
The term 'relog.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

SCRIPT ARGUMENTS:
Log: C:\Users\Jantero\Desktop\Autitoria_PAN&Past_SQL2012\PAN&past_PAL_Microsoft_SQL_Server_2012.blg
ThresholdFile: C:\Program Files\PAL\PAL\SQLServer2012.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: [My Documents]\PAL Reports
AllCounterStats: $False
NumberOfThreads: 4
IsLowPriority: $True
DisplayReport: True

Perfmon Log Translator

Hi,

I'm having some problems related to the language on the system. Looking at old codeplex I found people use to solve it with PLT but I cannot found it neither in the old nor new sites. Is the tool still available?

Ssd disks

Hi

In threshold html page after generating a report a see that value of disks is about 5400 rpm is there a way to adjust this or use ssd disks?

PAL Reports Folder under the Documents folder

Hi, if there is not PAL Reports Folder under the Documents folder powershell file throwing an error fastly. we can add quickly check that folder if it is exist or not. if it is not create folder for that program.

Length cannot be less than zero

Exception calling "Substring with "2" argument(s): "Length cannot be less than zero.
Parameter name: lenght"
Line: 112
$sLogFileName = $sLogFileName.SubString(0,$sLogFileName.Length - 4)
mstsc_2019-06-28_09-52-36

Error: "String was not recognized as a valid DateTime."

The Perf Mon file was saved as a csv. It is 4MB large, and was made from a Windows 2016 server.

Here is the error report:
Overall progress... Status: Creating the HTML report, PAL 2.8.1 Progress: 94%... Creating the HTML report,

An error occurred on...
$Date1 = Get-Date $([datetime]$global:oPal.aTime[0]) -format $global:sDateTimePattern
At C:\Program Files\PAL\PAL\PAL.ps1:4701 char:25 + $Date1 = Get-Date $([datetime]$global:oPal.aTime[0]) -format $glo ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cannot convert value "18:41.5,3526,0,0,0,0,0,0,0,0,0,0,0,0, , , , , ,,," to type "System.DateTime". Error: "String was not recognized as a valid DateTime."

Hi, i've been working on an older version, to manage french language / code updating.

Here the functions i used to it

Function Set-FrenchLocales
{
param()
$global:originalCulture = (Get-Culture)
$usenglishLocales = new-object System.Globalization.CultureInfo "fr-FR"
$global:currentThread.CurrentCulture = $usenglishLocales
$global:currentThread.CurrentUICulture = $usenglishLocales
}

Function GlobalizationCheck
{
$sDisplayName = (Get-Culture).DisplayName
Write-Host "Your locale is set to: $sDisplayName"
$global:currentThread = [System.Threading.Thread]::CurrentThread
If ($($sDisplayName.Contains('English')) -eq $false)
{
if($sDisplayName.Contains('France')){
$global:bEnglishLocale = $false
Write-Host 'Your locale is not English. PAL unfortunately must be running under an English locale. Setting it to English-US.'
Set-FrenchLocales
}
else{
$global:bEnglishLocale = $false
Write-Host 'Your locale is not English. PAL unfortunately must be running under an English locale. Setting it to English-US.'
Set-EnglishLocales
}
}
Else
{
$global:bEnglishLocale = $true
}
}
Function ReadThresholdFileIntoMemory
{
param($sThresholdFilePath)
[xml] (Get-Content $sThresholdFilePath -Encoding UTF8)
}
Function InheritFromThresholdFiles
{
param($sThresholdFilePath)

$XmlThresholdFile = [xml] (Get-Content $sThresholdFilePath -Encoding UTF8)
CheckPalXmlThresholdFileVersion -XmlThresholdFile $XmlThresholdFile
#// Add it to the threshold file load history, so that we don't get into an endless loop of inheritance.
If ($global:oXml.ThresholdFilePathLoadHistory.Contains($sThresholdFilePath) -eq $False)
{
    [void] $global:oXml.ThresholdFilePathLoadHistory.Add($sThresholdFilePath)
}

#// Inherit from other threshold files.
ForEach ($XmlInheritance in $XmlThresholdFile.SelectNodes('//INHERITANCE'))
{
    If ($(Test-FileExists $XmlInheritance.FilePath) -eq $True)
    {
        $XmlInherited = [xml] (Get-Content $XmlInheritance.FilePath -Encoding UTF8)
        ForEach ($XmlInheritedAnalysisNode in $XmlInherited.selectNodes('//ANALYSIS'))
        {
            $bFound = $False            
            ForEach ($XmlAnalysisNode in $global:oXml.XmlAnalyses.SelectNodes('//ANALYSIS'))
            {
                If (($(Test-property -InputObject $XmlInheritedAnalysisNode -Name 'ID') -eq $True) -and ($(Test-property -InputObject $XmlAnalysisNode -Name 'ID') -eq $True))
                {
                    If ($XmlInheritedAnalysisNode.ID -eq $XmlAnalysisNode.ID)
                    {
                        $bFound = $True
                        Break
                    }
                }

                If ($XmlInheritedAnalysisNode.NAME -eq $XmlAnalysisNode.NAME)
                {
                    $bFound = $True
                    Break
                }
            }
            If ($bFound -eq $False)
            {
                [void] $global:oXml.XmlAnalyses.AppendChild($global:oXml.XmlRoot.ImportNode($XmlInheritedAnalysisNode, $True))
            }
        }
        ForEach ($XmlInheritedQuestionNode in $XmlInherited.selectNodes("//QUESTION"))
        {
            $bFound = $False
            ForEach ($XmlQuestionNode in $global:oXml.XmlAnalyses.selectNodes("//QUESTION"))
            {
                If ($XmlInheritedQuestionNode.QUESTIONVARNAME -eq $XmlQuestionNode.QUESTIONVARNAME)
                {
                    $bFound = $True
                    Break
                }
            }
            If ($bFound -eq $False)
            {            
                [void] $global:oXml.XmlAnalyses.AppendChild($global:oXml.XmlRoot.ImportNode($XmlInheritedQuestionNode, $True))
            }
        }
        
		If ($global:oXml.ThresholdFilePathLoadHistory.Contains($XmlInheritance.FilePath) -eq $False)
		{
			InheritFromThresholdFiles $XmlInheritance.FilePath
		}
    }
}

}

Function GenerateThresholdFileCounterList
{
Write-Host 'Generating the counter list to filter on...' -NoNewline
$p = $global:oPal.Session.SessionWorkingDirectory + '\CounterListFilter.txt'
$c = New-Object System.Collections.ArrayList
ForEach ($XmlAnalysisInstance in $global:oXml.XmlAnalyses.SelectNodes('//ANALYSIS'))
{
If ($(ConvertTextTrueFalse $XmlAnalysisInstance.ENABLED) -eq $True)
{
ForEach ($XmlAnalysisDataSourceInstance in $XmlAnalysisInstance.SelectNodes('./DATASOURCE'))
{
If ($XmlAnalysisDataSourceInstance.TYPE -eq 'CounterLog')
{
If ($(Test-property -InputObject $XmlAnalysisDataSourceInstance -Name 'ISCOUNTEROBJECTREGULAREXPRESSION') -eq $True)
{
If ($(ConvertTextTrueFalse $XmlAnalysisDataSourceInstance.ISCOUNTEROBJECTREGULAREXPRESSION) -eq $True)
{
$oCtr = CounterPathToObject -sCounterPath $XmlAnalysisDataSourceInstance.EXPRESSIONPATH
If ($($oCtr.Instance) -eq $null)
{
$sNewExpressionPath = '' + '' + '' + "$($oCtr.Name)"
}
Else
{
$sNewExpressionPath = '' + '
' + '(' + "$($oCtr.Instance)" + ')' + "$($oCtr.Name)"
}
$c += $sNewExpressionPath
}
Else
{
$c += $XmlAnalysisDataSourceInstance.EXPRESSIONPATH
}
}
Else
{
$c += $XmlAnalysisDataSourceInstance.EXPRESSIONPATH
}
}
}
}
}
Write-Host 'Done'
Write-Host 'Removing duplicate counter expressions from counter list...' -NoNewline
#// Remove duplicate counter expression paths
$c = $c | select -uniq
$c | Out-File -FilePath $p -Encoding utf8
$global:oPal.Session.CounterListFilterFilePath = $p
Write-Host 'Done'
Write-Host ''
}
Function MergeConvertFilterPerfmonLogs
{
param($sPerfmonLogPaths, $BeginTime=$null, $EndTime=$null)
$sCommand = ''
$RelogOutput = ''
$IsSingleCsvFile = CheckIsSingleCsvFile -sPerfmonLogPaths $sPerfmonLogPaths
$global:oPal.RelogedLogFilePath = $global:oPal.Session.SessionWorkingDirectory + "_FilteredPerfmonLog.csv"
$global:sFirstCounterLogFilePath = $sPerfmonLogPaths

If ($IsSingleCsvFile -eq $False)
{
	$sTemp = ''
	If ($sPerfmonLogPaths.Contains(';'))
	{
		$aPerfmonLogPaths = $sPerfmonLogPaths.Split(';')
        $global:sFirstCounterLogFilePath = $aPerfmonLogPaths[0]
		For ($f=0;$f -lt $aPerfmonLogPaths.length;$f++)
		{
			$sTemp = $sTemp + " " + "`"" + $aPerfmonLogPaths[$f] + "`""
		}
		$sTemp = $sTemp.Trim()

        If ($global:oPal.ArgsProcessed.AllCounterStats -eq $True)
        {
            $sCommand = $('relog.exe ' + "`"$sTemp`"" + ' -f csv -o ' + "`"$($global:oPal.RelogedLogFilePath)`"")
            $outputLogFileANSIToUTF8 = $global:oPal.RelogedLogFilePath
        }
        Else
        {
            $sCommand = $('relog.exe ' + "`"$sTemp`"" + ' -cf ' + "`"$($global:oPal.Session.CounterListFilePath)`"" + ' -f csv -o ' + "`"$($global:oPal.RelogedLogFilePath)`"")
            $outputLogFileANSIToUTF8 = $global:oPal.Session.CounterListFilePath
            }
	}
	Else
	{
        $global:sFirstCounterLogFilePath = $sPerfmonLogPaths
        If ($global:oPal.ArgsProcessed.AllCounterStats -eq $True)
        {
            $sCommand = $('relog.exe ' + "`"$sPerfmonLogPaths`"" + ' -f csv -o ' + "`"$($global:oPal.RelogedLogFilePath)`"" + ' -y')
            $outputLogFileANSIToUTF8 = $global:oPal.RelogedLogFilePath
        }
        Else
        {
            $sCommand = 'relog.exe ' + "`"$sPerfmonLogPaths`"" + ' -cf ' + "`"$($global:oPal.Session.CounterListFilterFilePath)`"" + ' -f csv -o ' + "`"$($global:oPal.RelogedLogFilePath)`"" + ' -y'
            $outputLogFileANSIToUTF8 = $global:oPal.Session.CounterListFilePath
        }
	}
}
Else
{
    #// Just use the original CSV perfmon log.
    $global:oPal.RelogedLogFilePath = $sPerfmonLogPaths
    $global:sFirstCounterLogFilePath = $sPerfmonLogPaths
}

If (($global:oPal.ArgsProcessed.BeginTime -ne $null) -and ($global:oPal.ArgsProcessed.EndTime -ne $null))
{
    #// Fix provided by kwomba
    $sCommand = "$sCommand" + ' -b ' + "`"$($global:oPal.ArgsProcessed.BeginTime)`"" + ' -e ' + "`"$($global:oPal.ArgsProcessed.EndTime)`""
}

If ($IsSingleCsvFile -eq $False)
{
    Write-Host $sCommand
    Write-Host ''
    $RelogOutput = Invoke-Expression -Command $sCommand

    $tmpToDelete = $oPal.Session.UserTempDirectory + '\' + ([System.GUID]::NewGUID()).guid
    get-content $outputLogFileANSIToUTF8  | set-content $tmpToDelete -Encoding UTF8
    copy-item $tmpToDelete -destination  $outputLogFileANSIToUTF8
    #// Remove the extra blank lines and relog progress bar.
    Remove-Item $tmpToDelete -Force
    $RelogOutput | ForEach-Object {If (($_ -ne '') -and ($_.SubString(0,1) -ne 0)) {$_}}
}

$sRelogOutputAsSingleString = [string]::join("", $RelogOutput)
If ($sRelogOutputAsSingleString.contains('No data to return.') -eq $True)
{
    
    $sError = "Relog.exe failed to process the log. This commonly occurs when a BLG file from a Windows Vista or newer operating system is attempting to be analyze on Windows XP or Windows Server 2003, or due to log corruption. If you see this message on Windows XP or Server 2003, then try analyzing the log on Windows Vista/Server 2008 or later. Review the results above this line. If relog.exe continues to fail, then try running Relog.exe manually and/or contact Microsoft Customer Support Servers for support on Relog.exe only. PAL is not supported by Microsoft."
    WriteErrorToHtmlAndShow -sError $sError
    Break Main
}

$NewLogExists = Test-Path -Path $global:oPal.RelogedLogFilePath
If ($NewLogExists -eq $False)
{	
	$sError = $('[MergeConvertFilterPerfmonLogs] ERROR: Unable to find the converted log file: ' + "$($global:oPal.RelogedLogFilePath). " + "Relog.exe failed to process the log. Review the results above this line. If relog.exe continues to fail, then try running Relog.exe manually and/or contact Microsoft Customer Support Servers for support on Relog.exe only. PAL is not supported by Microsoft.")
    WriteErrorToHtmlAndShow -sError $sError
    Write-Error $sError
	Break Main
}

If (($IsSingleCsvFile -eq $False) -and ($RelogOutput -ne $null))
{
    If ($(IsSamplesInPerfmonLog -RelogOutput $RelogOutput) -eq $False)
    {
		$sError = $("[MergeConvertFilterPerfmonLogs] ERROR: Unable to use the log file(s): " + "$($global:oPal.ArgsOriginal.Log). " + "The counters in the log(s) do not contain any useable samples.")
        WriteErrorToHtmlAndShow -sError $sError
        Write-Error $sError
		Break Main
    }
}
If ($RelogOutput -ne $null)
{
    $NumberOfSamples = GetNumberOfSamplesFromRelogOutput -sRelogOutput $RelogOutput
    If ($NumberOfSamples -is [System.Int32])
    {
        If ($NumberOfSamples -lt 10)
        {
            $sText = $("ERROR: Not enough samples in the counter log to properly process. Create another performance counter log with more samples in it and try again. Number of samples is: " + "$NumberOfSamples")
            Write-Error $sText
            WriteErrorToHtmlAndShow -sError $sText
            Break Main
        }
    }
}

}
Function ConstructCounterDataArray
{
$PercentComplete = 0
$sComplete = "Progress: 0% (Counter ?? of ??)"
write-progress -activity 'Importing counter data into memory...' -status $sComplete -percentcomplete $PercentComplete -id 2

$oCSVFile = Get-Content -Path $global:oPal.RelogedLogFilePath -Encoding UTF8
#// Get the width and height of the CSV file as indexes.
$aLine = $oCSVFile[0].Trim('"') -split '","'
$iPerfmonCsvIndexWidth = $aLine.GetUpperBound(0)
$iPerfmonCsvIndexHeight = $oCSVFile.GetUpperBound(0)

If ($($oCSVFile[$iPerfmonCsvIndexHeight].Contains(',')) -eq $False)
{
	do 
	{
		$iPerfmonCsvIndexHeight = $iPerfmonCsvIndexHeight - 1
	} until ($($oCSVFile[$iPerfmonCsvIndexHeight].Contains(',')) -eq $true)	
}
For ($i=0;$i -le $iPerfmonCsvIndexHeight;$i++)
{
	$aLine = $oCSVFile[$i].Trim('"') -split '","'
	[void] $global:oPal.LogCounterData.Add($aLine)
    $PercentComplete = CalculatePercentage -Number $i -Total $iPerfmonCsvIndexHeight
    $sComplete = "Progress: $(ConvertToDataType $PercentComplete 'integer')% (Counter $i of $iPerfmonCsvIndexHeight)"
    write-progress -activity 'Importing counter data into memory...' -status $sComplete -percentcomplete $PercentComplete -id 2
}
$sComplete = "Progress: 100% (Counter $iPerfmonCsvIndexHeight of $iPerfmonCsvIndexHeight)"
write-progress -activity 'Importing counter data into memory...' -status $sComplete -Completed -id 2

}
Function GetTimeZoneFromCsvFile
{
param($CsvFilePath)

$oCSVFile = Get-Content $CsvFilePath -Encoding UTF8
$aRawCounterList = $oCSVFile[0].Split(",")
Return $aRawCounterList[0].Trim("`"")

}

Cannot import Perfmon templates

Attempting to import a Perfmon template generated using the "Export to Perfmon template file..." button on the Threshold File tab fails by greying out the Next and Finish buttons on the Create new Data Collector Set wizard (see image)
PAL_Template_not_importing
This seems to be caused by the and lines in the template XML file, referencing wdc.dll. If those lines are removed (or the XML fields left empty), the import works as expected.

Tested and confirmed as an issue when generating templates on a Windows Server 2016 instance (not tested generation on other instances), and confirmed as an issue importing to Windows Server 2012, 2012R2, 2016, 2016 HyperV and 2019, using the local PerfMon console, and a remote PerfMon console. (The 2016 HyperV instance doesn't have a local console, so only remote tested)
Tested using the SystemOverview template, and the SQL Server 2014 template, on PAL 2.8.1

Attached are two XMLs based on the SystemOverview template, one as exported from PAL, and one with manual corrections to make it import. Zipped because Github doesn't like loose XMLs.
Test XMLs.zip

Biztalk error

Overall progress... Status: Calculating counter statistics [very CPU intensive]..., PAL 2.8.2 Progress: 65%... Calculating counter statistics [very CPU intensive]...,

An error occurred on...
$iPercentComplete = ConvertToDataType $(($iIndexOfJobs / $iTotalJobs) * 100) 'integer'
At F:\Program Files\PAL\PAL\PAL.ps1:2526 char:49 + $iPercentComplete = ConvertToDataType $(($iIndexOfJobs / $iTotalJobs) * ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Attempted to divide by zero.

SCRIPT ARGUMENTS:
Log: F:\PerfLogs\Biztalk\PHPBIZ06_20190211-000026\Performance Counter.blg
ThresholdFile: F:\Program Files\PAL\PAL\BizTalkServer2006.xml
AnalysisInterval: AUTO
IsOutputHtml: $True
IsOutputXml: $False
HtmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].htm
XmlOutputFileName: [LogFileName]PAL_ANALYSIS[DateTimeStamp].xml
OutputDir: [My Documents]\PAL Reports\Biztalk
AllCounterStats: $False
NumberOfThreads: 8
IsLowPriority: $False
DisplayReport: True

Please contact the PAL tool team with this error by posting it to GitHub.com/clinthuffman/PAL. Thank you!

For detailed information, please look at the script execution log at

Increase the size of the graphs or make configurable

As an example, on servers that have multiple drives (e.g. say more than 4 or 5), it can be quite difficult to view the graphs that are generated from the performance counter data. It would be nice if either the graph size was increased to more standard size for monitors in current time, or make it configurable where we can adjust for our installation of PAL.

Method invocation failed because [System.Double] does not contain a method named 'GetUpperBound'.

I get the error below sometimes when I run this to analyze files. I have no idea where the PAL.log file is, it's not listed on the report file that show the error details, nor can I find it in %temp%. Happy to provide more data, just not sure where to find it. ;)

Was using the PAL wizard with the following options:
NO time range restriction
Auto-Detect for threshold file, and it added SystemOverview.xml and WindowsUpdate.xml
OS: Windows Server 2012 R2
PhysicalMemory: 32
Analysis Interval: 10 minutes
Process all of the counters in the log was checked

If a setting wasn't mentioned, it wasn't modified.

---------- ERROR BELOW ----------
Overall progress... Status: Creating charts, PAL 2.8.1 Progress: 76%... Creating charts, LogicalDisk Avg. Disk sec/Read

An error occurred on...
For ($i=0;$i -le $iValues.GetUpperBound(0);$i++)
At U:\Users\PAL_FlatFiles_2.8.1\PAL.ps1:3041 char:15 + For ($i=0;$i -le $iValues.GetUpperBound(0);$i++) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Method invocation failed because [System.Double] does not contain a method named 'GetUpperBound'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.