import ( "github.com/elastic/beats/libbeat/common" s "github.com/elastic/beats/metricbeat/schema" c "github.com/elastic/beats/metricbeat/schema/mapstrstr" ) var ( schema = s.Schema{ "clients": s.Object{ "connected": c.Int("connected_clients"), "longest_output_list": c.Int("client_longest_output_list"), "biggest_input_buf": c.Int("client_biggest_input_buf"), "blocked": c.Int("blocked_clients"), }, "cluster": s.Object{ "enabled": c.Bool("cluster_enabled"), }, "cpu": s.Object{ "used": s.Object{ "sys": c.Float("used_cpu_sys"), "user": c.Float("used_cpu_user"), "sys_children": c.Float("used_cpu_sys_children"), "user_children": c.Float("used_cpu_user_children"), }, }, "memory": s.Object{ "used": s.Object{ "value": c.Int("used_memory"), // As it is a top key, this goes into value "rss": c.Int("used_memory_rss"), "peak": c.Int("used_memory_peak"), "lua": c.Int("used_memory_lua"),
c "github.com/elastic/beats/metricbeat/schema/mapstrstr" ) // Based on: https://www.postgresql.org/docs/9.2/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW var schema = s.Schema{ "database": s.Object{ "oid": c.Int("datid"), "name": c.Str("datname"), }, "pid": c.Int("pid"), "user": s.Object{ "id": c.Int("usesysid"), "name": c.Str("usename"), }, "application_name": c.Str("application_name"), "client": s.Object{ "address": c.Str("client_addr"), "hostname": c.Str("client_hostname"), "port": c.Int("client_port"), }, "backend_start": c.Time(time.RFC3339Nano, "backend_start"), "transaction_start": c.Time(time.RFC3339Nano, "xact_start", s.Optional), "query_start": c.Time(time.RFC3339Nano, "query_start"), "state_change": c.Time(time.RFC3339Nano, "state_change"), "waiting": c.Bool("waiting"), "state": c.Str("state"), "query": c.Str("query"), } var eventMapping = schema.Apply