-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New module windows for metricbeat #3758
Merged
andrewkroh
merged 18 commits into
elastic:master
from
martinscholz83:module-perfmonbeat
Mar 28, 2017
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
43ee390
Add module windows
martinscholz83 569e7f4
import module
martinscholz83 a02bdc9
Format fields.yml
martinscholz83 331a56f
fix _meta
martinscholz83 30a1966
[WIP]
martinscholz83 d287fa9
add hints from @ruflin and @andrewkroh
martinscholz83 7e6b88c
mark first fetch
martinscholz83 9047b36
add tests
martinscholz83 8ab1da4
add integration tests; change error handling
martinscholz83 793bc1b
rename files
martinscholz83 24aa90d
map error codes
martinscholz83 6c01c1b
implement error interface
martinscholz83 251bc9c
ignore negative counter values
martinscholz83 f670912
update changelog.asciidoc
martinscholz83 267bf17
Merge branch 'master' into module-perfmonbeat
martinscholz83 88b0a79
make fmt && make update
martinscholz83 6cadedf
add perfmon doc.go
martinscholz83 dd2b539
rename integration test file
martinscholz83 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-module-windows]] | ||
== windows Module | ||
|
||
This is the windows Module. | ||
|
||
|
||
[float] | ||
=== Example Configuration | ||
|
||
The Windows module supports the standard configuration options that are described | ||
in <<configuration-metricbeat>>. Here is an example configuration: | ||
|
||
[source,yaml] | ||
---- | ||
metricbeat.modules: | ||
#- module: windows | ||
# metricsets: ["perfmon"] | ||
# enabled: true | ||
# period: 10s | ||
# perfmon.counters:---- | ||
|
||
[float] | ||
=== Metricsets | ||
|
||
The following metricsets are available: | ||
|
||
* <<metricbeat-metricset-windows-perfmon,perfmon>> | ||
|
||
include::windows/perfmon.asciidoc[] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-metricset-windows-perfmon]] | ||
include::../../../module/windows/perfmon/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-windows,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../module/windows/perfmon/_meta/data.json[] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#- module: windows | ||
# metricsets: ["perfmon"] | ||
# enabled: true | ||
# period: 10s | ||
# perfmon.counters: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
== windows Module | ||
|
||
This is the windows Module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- key: windows | ||
title: "Windows" | ||
description: > | ||
[]beta | ||
Module for Windows | ||
fields: | ||
- name: windows | ||
type: group | ||
description: > | ||
fields: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
Package windows is a Metricbeat module that contains MetricSets. | ||
*/ | ||
package windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"@timestamp":"2016-05-23T08:05:34.853Z", | ||
"beat":{ | ||
"hostname":"beathost", | ||
"name":"beathost" | ||
}, | ||
"metricset":{ | ||
"host":"localhost", | ||
"module":"mysql", | ||
"name":"status", | ||
"rtt":44269 | ||
}, | ||
"windows":{ | ||
"perfmon":{ | ||
"example": "perfmon" | ||
} | ||
}, | ||
"type":"metricsets" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
=== windows perfmon MetricSet | ||
|
||
This is the perfmon metricset of the module windows. | ||
|
||
[float] | ||
=== Features and configuration | ||
|
||
Metricset to collect performance counters. | ||
Example configuration: | ||
``` | ||
- module: windows | ||
metricsets: ["perfmon"] | ||
enabled: true | ||
period: 10s | ||
perfmon.counters: | ||
- group: "processor" | ||
collectors: | ||
- alias: "processor_time" | ||
query: '\Processor Information(_Total)\% Processor Time' | ||
- group: "disk" | ||
collectors: | ||
- alias: "bytes_written" | ||
query: '\PhysicalDisk(_Total)\Disk Writes/sec' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
- name: perfmon | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For dynamic metricsets, this will change so what we nomrally do is just define windows (module) part and leave the rest empty. Check the jmx metricset as an example. |
||
type: group | ||
fields: | ||
- name: counters | ||
type: group | ||
description: > | ||
Grouping of different counters | ||
fields: | ||
- name: group | ||
type: string | ||
description: > | ||
Name of the group. For example `processor` or `disk` | ||
|
||
- name: collectors | ||
type: group | ||
fields: | ||
- name: alias | ||
type: string | ||
description: > | ||
Short form for the query | ||
|
||
- name: query | ||
type: string | ||
description: > | ||
The query. For example `\\Processor Information(_Total)\\% Processor Performance`. Backslashes have to be escaped. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// +build ignore | ||
|
||
package perfmon | ||
|
||
/* | ||
#include <windows.h> | ||
#include <stdio.h> | ||
#include <conio.h> | ||
#include <pdh.h> | ||
#include <pdhmsg.h> | ||
#cgo LDFLAGS: -lpdh | ||
*/ | ||
import "C" | ||
|
||
const ( | ||
ERROR_SUCCESS = C.ERROR_SUCCESS | ||
PDH_STATUS_VALID_DATA = C.PDH_CSTATUS_VALID_DATA | ||
PDH_STATUS_NEW_DATA = C.PDH_CSTATUS_NEW_DATA | ||
PDH_NO_DATA = C.PDH_NO_DATA | ||
PDH_STATUS_NO_OBJECT = C.PDH_CSTATUS_NO_OBJECT | ||
PDH_STATUS_NO_COUNTER = C.PDH_CSTATUS_NO_COUNTER | ||
PDH_STATUS_INVALID_DATA = C.PDH_CSTATUS_INVALID_DATA | ||
PDH_INVALID_HANDLE = C.PDH_INVALID_HANDLE | ||
PDH_INVALID_DATA = C.PDH_INVALID_DATA | ||
PDH_NO_MORE_DATA = C.PDH_NO_MORE_DATA | ||
PDH_CALC_NEGATIVE_DEMONIATOR = C.PDH_CALC_NEGATIVE_DENOMINATOR | ||
PdhFmtDouble = C.PDH_FMT_DOUBLE | ||
PdhFmtLarge = C.PDH_FMT_LARGE | ||
PdhFmtLong = C.PDH_FMT_LONG | ||
) | ||
|
||
type PdhCounterValue C.PDH_FMT_COUNTERVALUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package perfmon | ||
|
||
const ( | ||
ERROR_SUCCESS = 0x0 | ||
PDH_STATUS_VALID_DATA = 0x0 | ||
PDH_STATUS_NEW_DATA = 0x1 | ||
PDH_NO_DATA = 0x800007d5 | ||
PDH_STATUS_NO_OBJECT = 0xc0000bb8 | ||
PDH_STATUS_NO_COUNTER = 0xc0000bb9 | ||
PDH_STATUS_INVALID_DATA = 0xc0000bba | ||
PDH_INVALID_HANDLE = 0xc0000bbc | ||
PDH_INVALID_DATA = 0xc0000bc6 | ||
PDH_NO_MORE_DATA = 0xc0000bcc | ||
PDH_CALC_NEGATIVE_DENOMINATOR = 0x800007d6 | ||
PdhFmtDouble = 0x00000200 | ||
PdhFmtLarge = 0x00000400 | ||
PdhFmtLong = 0x00000100 | ||
) | ||
|
||
type PdhCounterValue struct { | ||
CStatus uint32 | ||
Pad_cgo_0 [4]byte | ||
LongValue int32 | ||
Pad_cgo_1 [4]byte | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package perfmon | ||
|
||
const ( | ||
ERROR_SUCCESS = 0x0 | ||
PDH_STATUS_VALID_DATA = 0x0 | ||
PDH_STATUS_NEW_DATA = 0x1 | ||
PDH_NO_DATA = 0x800007d5 | ||
PDH_STATUS_NO_OBJECT = 0xc0000bb8 | ||
PDH_STATUS_NO_COUNTER = 0xc0000bb9 | ||
PDH_STATUS_INVALID_DATA = 0xc0000bba | ||
PDH_INVALID_HANDLE = 0xc0000bbc | ||
PDH_INVALID_DATA = 0xc0000bc6 | ||
PDH_NO_MORE_DATA = 0xc0000bcc | ||
PDH_CALC_NEGATIVE_DENOMINATOR = 0x800007d6 | ||
PdhFmtDouble = 0x00000200 | ||
PdhFmtLarge = 0x00000400 | ||
PdhFmtLong = 0x00000100 | ||
) | ||
|
||
type PdhCounterValue struct { | ||
CStatus uint32 | ||
Pad_cgo_0 [4]byte | ||
LongValue int32 | ||
Pad_cgo_1 [4]byte | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
Package perfmon collect windows performance counters. | ||
*/ | ||
package perfmon |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mark this as beta: https://github.com/elastic/beats/blob/master/metricbeat/module/jolokia/_meta/fields.yml#L4