forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.go
41 lines (38 loc) · 1.13 KB
/
data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package database
import (
"time"
s "github.com/elastic/beats/libbeat/common/schema"
c "github.com/elastic/beats/libbeat/common/schema/mapstrstr"
)
// Based on https://www.postgresql.org/docs/9.2/static/monitoring-stats.html#PG-STAT-DATABASE-VIEW
var schema = s.Schema{
"oid": c.Int("datid"),
"name": c.Str("datname"),
"number_of_backends": c.Int("numbackends"),
"transactions": s.Object{
"commit": c.Int("xact_commit"),
"rollback": c.Int("xact_rollback"),
},
"blocks": s.Object{
"read": c.Int("blks_read"),
"hit": c.Int("blks_hit"),
"time": s.Object{
"read": s.Object{"ms": c.Int("blk_read_time")},
"write": s.Object{"ms": c.Int("blk_write_time")},
},
},
"rows": s.Object{
"returned": c.Int("tup_returned"),
"fetched": c.Int("tup_fetched"),
"inserted": c.Int("tup_inserted"),
"updated": c.Int("tup_updated"),
"deleted": c.Int("tup_deleted"),
},
"conflicts": c.Int("conflicts"),
"temporary": s.Object{
"files": c.Int("temp_files"),
"bytes": c.Int("temp_bytes"),
},
"deadlocks": c.Int("deadlocks"),
"stats_reset": c.Time(time.RFC3339Nano, "stats_reset", s.Optional),
}