Commit 7a50bb69 authored by Andres Freund's avatar Andres Freund

Add 'unit' parameter to ExplainProperty{Integer,Float}.

This allows to deduplicate some existing code, but mainly avoids some
duplication in upcoming commits.

In passing, fix variable names indicating wrong unit (seconds instead
of ms).

Author: Andres Freund
Discussion: https://postgr.es/m/20180314002740.cah3mdsonz5mxney@alap3.anarazel.de
parent f3e4b95e
...@@ -622,7 +622,7 @@ fileExplainForeignScan(ForeignScanState *node, ExplainState *es) ...@@ -622,7 +622,7 @@ fileExplainForeignScan(ForeignScanState *node, ExplainState *es)
if (!is_program && if (!is_program &&
stat(filename, &stat_buf) == 0) stat(filename, &stat_buf) == 0)
ExplainPropertyInteger("Foreign File Size", ExplainPropertyInteger("Foreign File Size", "b",
(int64) stat_buf.st_size, es); (int64) stat_buf.st_size, es);
} }
} }
......
This diff is collapsed.
...@@ -93,10 +93,10 @@ extern void ExplainPropertyListNested(const char *qlabel, List *data, ...@@ -93,10 +93,10 @@ extern void ExplainPropertyListNested(const char *qlabel, List *data,
ExplainState *es); ExplainState *es);
extern void ExplainPropertyText(const char *qlabel, const char *value, extern void ExplainPropertyText(const char *qlabel, const char *value,
ExplainState *es); ExplainState *es);
extern void ExplainPropertyInteger(const char *qlabel, int64 value, extern void ExplainPropertyInteger(const char *qlabel, const char *unit,
ExplainState *es); int64 value, ExplainState *es);
extern void ExplainPropertyFloat(const char *qlabel, double value, int ndigits, extern void ExplainPropertyFloat(const char *qlabel, const char *unit,
ExplainState *es); double value, int ndigits, ExplainState *es);
extern void ExplainPropertyBool(const char *qlabel, bool value, extern void ExplainPropertyBool(const char *qlabel, bool value,
ExplainState *es); ExplainState *es);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment