From 8af0c1f099e71b9cb826490febce97678d6707c4 Mon Sep 17 00:00:00 2001 From: Edouard Buschini Date: Thu, 7 Feb 2019 20:21:05 -0500 Subject: [PATCH] Wrong template for postgresql statement module 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 --- metricbeat/docs/fields.asciidoc | 36 +++++----- metricbeat/module/postgresql/fields.go | 2 +- .../postgresql/statement/_meta/data.json | 66 +++++++++++-------- .../postgresql/statement/_meta/fields.yml | 36 +++++----- 4 files changed, 75 insertions(+), 65 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 4517a8232006..3f1d2073582e 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -19633,37 +19633,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 @@ -19673,7 +19673,7 @@ Mean number of milliseconds spent running query. -- -*`postgresql.statement.time.stddev`*:: +*`postgresql.statement.query.time.stddev.ms`*:: + -- type: long @@ -19683,7 +19683,7 @@ Population standard deviation of time spent running query, in milliseconds. -- -*`postgresql.statement.memory.shared.hit`*:: +*`postgresql.statement.query.memory.shared.hit`*:: + -- type: long @@ -19693,7 +19693,7 @@ Total number of shared block cache hits by the query. -- -*`postgresql.statement.memory.shared.read`*:: +*`postgresql.statement.query.memory.shared.read`*:: + -- type: long @@ -19703,7 +19703,7 @@ Total number of shared block cache read by the query. -- -*`postgresql.statement.memory.shared.dirtied`*:: +*`postgresql.statement.query.memory.shared.dirtied`*:: + -- type: long @@ -19713,7 +19713,7 @@ Total number of shared block cache dirtied by the query. -- -*`postgresql.statement.memory.shared.written`*:: +*`postgresql.statement.query.memory.shared.written`*:: + -- type: long @@ -19723,7 +19723,7 @@ Total number of shared block cache written by the query. -- -*`postgresql.statement.memory.local.hit`*:: +*`postgresql.statement.query.memory.local.hit`*:: + -- type: long @@ -19733,7 +19733,7 @@ Total number of local block cache hits by the query. -- -*`postgresql.statement.memory.local.read`*:: +*`postgresql.statement.query.memory.local.read`*:: + -- type: long @@ -19743,7 +19743,7 @@ Total number of local block cache read by the query. -- -*`postgresql.statement.memory.local.dirtied`*:: +*`postgresql.statement.query.memory.local.dirtied`*:: + -- type: long @@ -19753,7 +19753,7 @@ Total number of local block cache dirtied by the query. -- -*`postgresql.statement.memory.local.written`*:: +*`postgresql.statement.query.memory.local.written`*:: + -- type: long @@ -19763,7 +19763,7 @@ Total number of local block cache written by the query. -- -*`postgresql.statement.memory.temp.read`*:: +*`postgresql.statement.query.memory.temp.read`*:: + -- type: long @@ -19773,7 +19773,7 @@ Total number of temp block cache read by the query. -- -*`postgresql.statement.memory.temp.written`*:: +*`postgresql.statement.query.memory.temp.written`*:: + -- type: long diff --git a/metricbeat/module/postgresql/fields.go b/metricbeat/module/postgresql/fields.go index ac394555f73c..2ded1e5f4ec3 100644 --- a/metricbeat/module/postgresql/fields.go +++ b/metricbeat/module/postgresql/fields.go @@ -32,5 +32,5 @@ func init() { // AssetPostgresql returns asset data. // This is the base64 encoded gzipped contents of ../metricbeat/module/postgresql. func AssetPostgresql() string { - return "eJzUWk+P27oRv++nGLxLksIR0OseChR5hwZo8vKQ9GyMyZFFmCIVkrLX/fTFkJIsS7LX3pW2eT7t2uJvfpwZzj/qI+zo+AiV9WHryP/UDwBBBU2P8Nu39OX3P//92wOAJC+cqoKy5hH+8QAA8IWCU8KDsFqTCCQhd7aE0zrw5PbkfPYA4AvrwlpYk6vtI+SoPT0AONKE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Nr8f5cBRCxXXHu3Hd5d/rLkje8mWrbhIVtGIxFuwTt6pv/u5e/60HW2kY3mCe3C3Op6+OS2vPS3I9vdx5g/BnvCQcrjuFFajUAtm0nTpH1bZXFra6qFyucWbNMvpytX7G9WqN87EMJ3T2a52OVr+JaXq+SuvuivgawULqGel9kVoWVTErQXyZkyC+zE6Q8KwK7/e7L4R6TnbOpynt5+P3zZSViinKedQp2hRS2ssua/WmD32mN94FRuoFFcYeE5ejpXTGqdPw+EQBcYQQpzVxHlTfw11V8SnPGQd2NxANM67HiKbSejlbj3kD11rgg3Tr4v7t6A6uY2+lq4xAtaC3BvxXO2tkuaCvjmk+4qqR5rKeOmb6oKNGssv66Zjsg27KbeaS9mf8V5s/kFxWoSOe0/r8XwAAAP//xMZFkg==" } diff --git a/metricbeat/module/postgresql/statement/_meta/data.json b/metricbeat/module/postgresql/statement/_meta/data.json index 6350be5ca4ae..2ef8bdde79c0 100644 --- a/metricbeat/module/postgresql/statement/_meta/data.json +++ b/metricbeat/module/postgresql/statement/_meta/data.json @@ -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 } } } diff --git a/metricbeat/module/postgresql/statement/_meta/fields.yml b/metricbeat/module/postgresql/statement/_meta/fields.yml index 0974349e2cab..f8e315354a44 100644 --- a/metricbeat/module/postgresql/statement/_meta/fields.yml +++ b/metricbeat/module/postgresql/statement/_meta/fields.yml @@ -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.