Skip to content

Commit

Permalink
Wrong template for postgresql statement module (elastic#10631)
Browse files Browse the repository at this point in the history
According to: https://github.com/elastic/beats/blob/master/metricbeat/module/postgresql/statement/data.go the default template casts a `long` for a `ms: float` type object
  • Loading branch information
tehmoon authored and kaiyan-sheng committed Feb 18, 2019
1 parent 1438323 commit c8b2f1c
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 65 deletions.
36 changes: 18 additions & 18 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19753,37 +19753,37 @@ Total number of rows returned by query.
--
*`postgresql.statement.time.total`*::
*`postgresql.statement.query.time.total.ms`*::
+
--
type: long
type: float
Total number of milliseconds spent running query.
--
*`postgresql.statement.time.min`*::
*`postgresql.statement.query.time.min.ms`*::
+
--
type: long
type: float
Minimum number of milliseconds spent running query.
--
*`postgresql.statement.time.max`*::
*`postgresql.statement.query.time.max.ms`*::
+
--
type: long
type: float
Maximum number of milliseconds spent running query.
--
*`postgresql.statement.time.mean`*::
*`postgresql.statement.query.time.mean.ms`*::
+
--
type: long
Expand All @@ -19793,7 +19793,7 @@ Mean number of milliseconds spent running query.
--
*`postgresql.statement.time.stddev`*::
*`postgresql.statement.query.time.stddev.ms`*::
+
--
type: long
Expand All @@ -19803,7 +19803,7 @@ Population standard deviation of time spent running query, in milliseconds.
--
*`postgresql.statement.memory.shared.hit`*::
*`postgresql.statement.query.memory.shared.hit`*::
+
--
type: long
Expand All @@ -19813,7 +19813,7 @@ Total number of shared block cache hits by the query.
--
*`postgresql.statement.memory.shared.read`*::
*`postgresql.statement.query.memory.shared.read`*::
+
--
type: long
Expand All @@ -19823,7 +19823,7 @@ Total number of shared block cache read by the query.
--
*`postgresql.statement.memory.shared.dirtied`*::
*`postgresql.statement.query.memory.shared.dirtied`*::
+
--
type: long
Expand All @@ -19833,7 +19833,7 @@ Total number of shared block cache dirtied by the query.
--
*`postgresql.statement.memory.shared.written`*::
*`postgresql.statement.query.memory.shared.written`*::
+
--
type: long
Expand All @@ -19843,7 +19843,7 @@ Total number of shared block cache written by the query.
--
*`postgresql.statement.memory.local.hit`*::
*`postgresql.statement.query.memory.local.hit`*::
+
--
type: long
Expand All @@ -19853,7 +19853,7 @@ Total number of local block cache hits by the query.
--
*`postgresql.statement.memory.local.read`*::
*`postgresql.statement.query.memory.local.read`*::
+
--
type: long
Expand All @@ -19863,7 +19863,7 @@ Total number of local block cache read by the query.
--
*`postgresql.statement.memory.local.dirtied`*::
*`postgresql.statement.query.memory.local.dirtied`*::
+
--
type: long
Expand All @@ -19873,7 +19873,7 @@ Total number of local block cache dirtied by the query.
--
*`postgresql.statement.memory.local.written`*::
*`postgresql.statement.query.memory.local.written`*::
+
--
type: long
Expand All @@ -19883,7 +19883,7 @@ Total number of local block cache written by the query.
--
*`postgresql.statement.memory.temp.read`*::
*`postgresql.statement.query.memory.temp.read`*::
+
--
type: long
Expand All @@ -19893,7 +19893,7 @@ Total number of temp block cache read by the query.
--
*`postgresql.statement.memory.temp.written`*::
*`postgresql.statement.query.memory.temp.written`*::
+
--
type: long
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/postgresql/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 38 additions & 28 deletions metricbeat/module/postgresql/statement/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,48 @@
"id": 10
},
"database": {
"oid": "12407"
"oid": 175251
},
"query": {
"id": "3240664890",
"text": "SELECT pg_sleep(?);",
"calls": "2",
"rows": "2",
"text": "ROLLBACK",
"memory": {
"shared": {
"hit": 0,
"read": 0,
"dirtied": 0,
"written": 0
},
"temp": {
"read": 0,
"written": 0
},
"local": {
"hit": 0,
"read": 0,
"dirtied": 0,
"written": 0
}
},
"id": "961354038",
"rows": 0,
"time": {
"total": 120066.497,
"min": 60029.533,
"max": 60036.964,
"mean": 60033.2485,
"stddev": 3.71549999999843
"min": {
"ms": 0
},
"total": {
"ms": 0.02900000000000002
},
"stddev": {
"ms": 0.0003768830273792263
},
"max": {
"ms": 0.001
},
"mean": {
"ms": 0.0008285714285714287
}
},
"memory": {
"shared": {
"hit": 0,
"read": 0,
"dirtied": 0,
"written": 0,
},
"local": {
"hit": 0,
"read": 0,
"dirtied": 0,
"written": 0,
},
"temp": {
"read": 0,
"written": 0,
}
}
"calls": 35
}
}
}
Expand Down
36 changes: 18 additions & 18 deletions metricbeat/module/postgresql/statement/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,63 +29,63 @@
type: long
description: >
Total number of rows returned by query.
- name: time.total
type: long
- name: query.time.total.ms
type: float
description: >
Total number of milliseconds spent running query.
- name: time.min
type: long
- name: query.time.min.ms
type: float
description: >
Minimum number of milliseconds spent running query.
- name: time.max
type: long
- name: query.time.max.ms
type: float
description: >
Maximum number of milliseconds spent running query.
- name: time.mean
- name: query.time.mean.ms
type: long
description: >
Mean number of milliseconds spent running query.
- name: time.stddev
- name: query.time.stddev.ms
type: long
description: >
Population standard deviation of time spent running query, in milliseconds.
- name: memory.shared.hit
- name: query.memory.shared.hit
type: long
description: >
Total number of shared block cache hits by the query.
- name: memory.shared.read
- name: query.memory.shared.read
type: long
description: >
Total number of shared block cache read by the query.
- name: memory.shared.dirtied
- name: query.memory.shared.dirtied
type: long
description: >
Total number of shared block cache dirtied by the query.
- name: memory.shared.written
- name: query.memory.shared.written
type: long
description: >
Total number of shared block cache written by the query.
- name: memory.local.hit
- name: query.memory.local.hit
type: long
description: >
Total number of local block cache hits by the query.
- name: memory.local.read
- name: query.memory.local.read
type: long
description: >
Total number of local block cache read by the query.
- name: memory.local.dirtied
- name: query.memory.local.dirtied
type: long
description: >
Total number of local block cache dirtied by the query.
- name: memory.local.written
- name: query.memory.local.written
type: long
description: >
Total number of local block cache written by the query.
- name: memory.temp.read
- name: query.memory.temp.read
type: long
description: >
Total number of temp block cache read by the query.
- name: memory.temp.written
- name: query.memory.temp.written
type: long
description: >
Total number of temp block cache written by the query.

0 comments on commit c8b2f1c

Please sign in to comment.