である私はPowerShellを使用してパフォーマンスカウンタを作成しようとしていますが、原因AverageCount64の私の使用に次のエラーを取得しています:パフォーマンス比較は、PowerShellをカウンタの作成:指定したカテゴリのカウンタのレイアウトが無効
「カウンターレイアウトを指定されたカテゴリが無効であるため、タイプのカウンタ :AverageBase、CounterMultiBase:AverageCount64、AverageTimer32、CounterMultiTimer、 CounterMultiTimerInverse、 CounterMultiTimer100Ns、CounterMultiTimer100NsInverse、RawFraction、または SampleFractionは直ちにベース カウンタタイプのいずれかが続くされなければなりません、RawBaseまたはS ampleBase "
私はAverageCount64ですが、私はAverageBaseを必要としないタイプ(RateOfCountsPerSecond64)を持っている、特に以来、私のコードでそれを追加する方法がわからないよなタイプのためAverageBaseを追加する必要があることを知っている:
$AnalyticsCollection = New-Object System.Diagnostics.CounterCreationDataCollection
$AnalyticsCollection.Add((New-Object $ccdTypeName "Aggregation | Total Aggregation Errors/sec", "The total number of interactions which could not be aggregated due to an exception.", RateOfCountsPerSecond64))
$AnalyticsCollection.Add((New-Object $ccdTypeName "Aggregation | Average Check Out Time - History (ms)", "Average time it takes to obtain a work item from a range scheduler while rebuilding the reporting database.", AverageCount64))
$AnalyticsCollection.Add((New-Object $ccdTypeName "Collection | Total Visits/sec", "The total number of visits per second that are registered by the system.", RateOfCountsPerSecond64))
$AnalyticsCollection.Add((New-Object $ccdTypeName "Aggregation | Average Check In Time - History (ms)", "Average time it takes to mark a work item as completed in a range scheduler while rebuilding the reporting database.", AverageCount64))
[System.Diagnostics.PerformanceCounterCategory]::Create("My Counters", "I love my performance counters", [Diagnostics.PerformanceCounterCategoryType]::MultiInstance, $AnalyticsCollection) | out-null
感謝。私の実際のコレクションは70以上のカウンターがあり、あるものはAverageBaseが必要です。混合型の複数のカウンターではどのように機能しますか? – Kode
私はあなたがAveragebaseかRawfractionであるかどうかにかかわらず、基礎となるカウンターのタイプを指定することができると思います。そのため、追加の周りにループを作成し、AnalyticsCollection変数に追加する各アイテムに使用する必要があるタイプを変更するだけで済みます。 –