Skip to content

Commit

Permalink
Add data files for further metricsets (elastic#1785)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin authored and tsg committed Jun 6, 2016
1 parent a041c20 commit d1364aa
Show file tree
Hide file tree
Showing 22 changed files with 333 additions and 233 deletions.
1 change: 0 additions & 1 deletion metricbeat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ RUN set -x \

# Setup work environment
ENV METRICBEAT_PATH /go/src/github.com/elastic/beats/metricbeat
ENV GO15VENDOREXPERIMENT=1

RUN mkdir -p $METRICBEAT_PATH/build/coverage
WORKDIR $METRICBEAT_PATH
2 changes: 1 addition & 1 deletion metricbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ create-metricset:
# Generates the data.json example documents
.PHONY: generate-json
generate-json:
go test github.com/elastic/beats/metricbeat/module/... -data
${DOCKER_COMPOSE} run beat go test -tags=integration github.com/elastic/beats/metricbeat/module/... -data
2 changes: 1 addition & 1 deletion metricbeat/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ waitFor() {
done

echo
echo >&2 '${3} is not available'
echo >&2 "${3} is not available"
echo >&2 "Address: ${1}:${2}"
}

Expand Down
116 changes: 62 additions & 54 deletions metricbeat/module/apache/status/_beat/data.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,66 @@
{
"@timestamp":"2016-05-11T07:25:22.343Z",
"apache-status":{
"busyWorkers":0,
"bytesPerReq":0,
"bytesPerSec":0,
"connections":{
"connsAsyncClosing":0,
"connsAsyncKeepAlive":0,
"connsAsyncWriting":0,
"connsTotal":0
},
"cpu":{
"cpuChildrenSystem":0,
"cpuChildrenUser":0,
"cpuLoad":0,
"cpuSystem":0,
"cpuUser":0
},
"hostname":"http://apache/",
"idleWorkers":0,
"load":{
"load1":0,
"load15":0,
"load5":0
},
"reqPerSec":0,
"scoreboard":{
"closingConnection":0,
"dnsLookup":0,
"gracefullyFinishing":0,
"idleCleanup":0,
"keepalive":0,
"logging":0,
"openSlot":0,
"readingRequest":0,
"sendingReply":0,
"startingUp":0,
"total":0,
"waitingForConnection":0
},
"totalAccesses":0,
"totalKBytes":0,
"uptime":{
"serverUptimeSeconds":0,
"uptime":0
"@timestamp": "2016-05-23T08:05:34.853Z",
"apache": {
"status": {
"bytes_per_request": 916.211,
"bytes_per_sec": 10.921,
"connections": {
"async": {
"closing": 0,
"keep_alive": 0,
"writing": 0
},
"total": 0
},
"cpu": {
"children_system": 0,
"children_user": 0,
"load": 0.0890841,
"system": 0.77,
"user": 0.65
},
"hostname": "apache",
"load": {
"1": 1.53,
"15": 0.53,
"5": 0.92
},
"requests_per_sec": 0.0119197,
"scoreboard": {
"closing_connection": 0,
"dns_lookup": 0,
"gracefully_finishing": 0,
"idle_cleanup": 0,
"keepalive": 0,
"logging": 0,
"open_slot": 325,
"reading_request": 0,
"sending_reply": 1,
"starting_up": 0,
"total": 400,
"waiting_for_connection": 74
},
"total_accesses": 19,
"total_kbytes": 17,
"uptime": {
"server_uptime": 1594,
"uptime": 1594
},
"workers": {
"busy": 1,
"idle": 74
}
}
},
"beat":{
"hostname":"9447b637514b",
"name":"9447b637514b"
"beat": {
"hostname": "host.example.com",
"name": "host.example.com"
},
"metricset":"status",
"metricset-host":"http://apache/",
"module":"apache",
"rtt":8564,
"type":"metricsets"
}
"metricset": {
"host": "localhost",
"module": "apache",
"name": "status",
"rtt": 115
},
"type": "metricsets"
}
9 changes: 9 additions & 0 deletions metricbeat/module/apache/status/status_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ func TestFetch(t *testing.T) {
assert.Equal(t, 12, len(event))
}

func TestData(t *testing.T) {
f := mbtest.NewEventFetcher(t, getConfig())

err := mbtest.WriteEvent(f, t)
if err != nil {
t.Fatal("write", err)
}
}

func getConfig() map[string]interface{} {
return map[string]interface{}{
"module": "apache",
Expand Down
80 changes: 40 additions & 40 deletions metricbeat/module/mysql/status/_beat/data.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
{
"@timestamp":"2016-05-23T08:05:34.853Z",
"beat":{
"hostname":"ruflin",
"name":"ruflin"
"@timestamp": "2016-05-23T08:05:34.853Z",
"beat": {
"hostname": "host.example.com",
"name": "host.example.com"
},
"metricset":{
"host":"root:test@tcp(localhost:3306)/",
"module":"mysql",
"name":"status",
"rtt":44269
"metricset": {
"host": "localhost",
"module": "mysql",
"name": "status",
"rtt": 115
},
"mysql":{
"status":{
"aborted":{
"clients":2,
"connects":0
"mysql": {
"status": {
"aborted": {
"clients": 13,
"connects": 11
},
"binlog":{
"cache":{
"disk_use":0,
"use":0
"binlog": {
"cache": {
"disk_use": 0,
"use": 0
}
},
"bytes":{
"received":456,
"sent":20079
"bytes": {
"received": 2280,
"sent": 140556
},
"connections":5,
"created":{
"tmp":{
"disk_tables":0,
"files":6,
"tables":0
"connections": 28,
"created": {
"tmp": {
"disk_tables": 0,
"files": 6,
"tables": 0
}
},
"delayed":{
"errors":0,
"insert_threads":0,
"writes":0
"delayed": {
"errors": 0,
"insert_threads": 0,
"writes": 0
},
"flush_commands":1,
"max_used_connections":1,
"open":{
"files":14,
"streams":0,
"tables":101
"flush_commands": 1,
"max_used_connections": 2,
"open": {
"files": 14,
"streams": 0,
"tables": 110
},
"opened_tables":108
"opened_tables": 117
}
},
"type":"metricsets"
}
"type": "metricsets"
}
9 changes: 9 additions & 0 deletions metricbeat/module/mysql/status/status_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ func TestFetch(t *testing.T) {
assert.True(t, openStreams == 0)
}

func TestData(t *testing.T) {
f := mbtest.NewEventFetcher(t, getConfig())

err := mbtest.WriteEvent(f, t)
if err != nil {
t.Fatal("write", err)
}
}

func getConfig() map[string]interface{} {
return map[string]interface{}{
"module": "mysql",
Expand Down
28 changes: 28 additions & 0 deletions metricbeat/module/nginx/stubstatus/_beat/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"@timestamp": "2016-05-23T08:05:34.853Z",
"beat": {
"hostname": "host.example.com",
"name": "host.example.com"
},
"metricset": {
"host": "localhost",
"module": "nginx",
"name": "stubstatus",
"rtt": 115
},
"nginx": {
"stubstatus": {
"accepts": 19,
"active": 1,
"current": 14,
"dropped": 0,
"handled": 19,
"hostname": "nginx",
"reading": 0,
"requests": 14,
"waiting": 0,
"writing": 1
}
},
"type": "metricsets"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ func TestFetch(t *testing.T) {
assert.Equal(t, 10, len(event))
}

func TestData(t *testing.T) {
f := mbtest.NewEventFetcher(t, getConfig())

err := mbtest.WriteEvent(f, t)
if err != nil {
t.Fatal("write", err)
}
}

func getConfig() map[string]interface{} {
return map[string]interface{}{
"module": "nginx",
Expand Down
Loading

0 comments on commit d1364aa

Please sign in to comment.