Fix part 2 of #1291

added PDH_FMT_NOCAP100 format option

closes #2483
This commit is contained in:
vvvkamper 2017-03-02 19:15:33 +07:00 committed by Cameron Sparr
parent 9df2974a0f
commit 7513fcac4e
No known key found for this signature in database
GPG Key ID: 19E67263DCB25D0F
2 changed files with 3 additions and 2 deletions

View File

@ -74,6 +74,7 @@ be deprecated eventually.
- [#2178](https://github.com/influxdata/telegraf/issues/2178): logparser: regexp with lookahead. - [#2178](https://github.com/influxdata/telegraf/issues/2178): logparser: regexp with lookahead.
- [#2466](https://github.com/influxdata/telegraf/issues/2466): Telegraf can crash in LoadDirectory on 0600 files. - [#2466](https://github.com/influxdata/telegraf/issues/2466): Telegraf can crash in LoadDirectory on 0600 files.
- [#2215](https://github.com/influxdata/telegraf/issues/2215): Iptables input: document better that rules without a comment are ignored. - [#2215](https://github.com/influxdata/telegraf/issues/2215): Iptables input: document better that rules without a comment are ignored.
- [#2483](https://github.com/influxdata/telegraf/pull/2483): Fix win_perf_counters capping values at 100.
## v1.2.1 [2017-02-01] ## v1.2.1 [2017-02-01]

View File

@ -331,7 +331,7 @@ func PdhCollectQueryData(hQuery PDH_HQUERY) uint32 {
func PdhGetFormattedCounterValueDouble(hCounter PDH_HCOUNTER, lpdwType *uint32, pValue *PDH_FMT_COUNTERVALUE_DOUBLE) uint32 { func PdhGetFormattedCounterValueDouble(hCounter PDH_HCOUNTER, lpdwType *uint32, pValue *PDH_FMT_COUNTERVALUE_DOUBLE) uint32 {
ret, _, _ := pdh_GetFormattedCounterValue.Call( ret, _, _ := pdh_GetFormattedCounterValue.Call(
uintptr(hCounter), uintptr(hCounter),
uintptr(PDH_FMT_DOUBLE), uintptr(PDH_FMT_DOUBLE|PDH_FMT_NOCAP100),
uintptr(unsafe.Pointer(lpdwType)), uintptr(unsafe.Pointer(lpdwType)),
uintptr(unsafe.Pointer(pValue))) uintptr(unsafe.Pointer(pValue)))
@ -378,7 +378,7 @@ func PdhGetFormattedCounterValueDouble(hCounter PDH_HCOUNTER, lpdwType *uint32,
func PdhGetFormattedCounterArrayDouble(hCounter PDH_HCOUNTER, lpdwBufferSize *uint32, lpdwBufferCount *uint32, itemBuffer *PDH_FMT_COUNTERVALUE_ITEM_DOUBLE) uint32 { func PdhGetFormattedCounterArrayDouble(hCounter PDH_HCOUNTER, lpdwBufferSize *uint32, lpdwBufferCount *uint32, itemBuffer *PDH_FMT_COUNTERVALUE_ITEM_DOUBLE) uint32 {
ret, _, _ := pdh_GetFormattedCounterArrayW.Call( ret, _, _ := pdh_GetFormattedCounterArrayW.Call(
uintptr(hCounter), uintptr(hCounter),
uintptr(PDH_FMT_DOUBLE), uintptr(PDH_FMT_DOUBLE|PDH_FMT_NOCAP100),
uintptr(unsafe.Pointer(lpdwBufferSize)), uintptr(unsafe.Pointer(lpdwBufferSize)),
uintptr(unsafe.Pointer(lpdwBufferCount)), uintptr(unsafe.Pointer(lpdwBufferCount)),
uintptr(unsafe.Pointer(itemBuffer))) uintptr(unsafe.Pointer(itemBuffer)))