aboutsummaryrefslogtreecommitdiff
path: root/contrib/auto_explain/auto_explain.c
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2016-03-13 13:18:03 +0100
committerMagnus Hagander <magnus@hagander.net>2016-03-13 13:18:03 +0100
commit7a8d8748362d4d8505e320c3eaab4a2c2463e3a6 (patch)
tree78f6662170b707950285580125be6db118c18106 /contrib/auto_explain/auto_explain.c
parenta1aa8b7ea0558620106e25c27d0a70ee4ac9d6a8 (diff)
downloadpostgresql-7a8d8748362d4d8505e320c3eaab4a2c2463e3a6.tar.gz
postgresql-7a8d8748362d4d8505e320c3eaab4a2c2463e3a6.zip
Rename auto_explain.sample_ratio to sample_rate
Per suggestion from Tomas Vondra Author: Julien Rouhaud
Diffstat (limited to 'contrib/auto_explain/auto_explain.c')
-rw-r--r--contrib/auto_explain/auto_explain.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/auto_explain/auto_explain.c b/contrib/auto_explain/auto_explain.c
index 6708d817fba..fcd11a00713 100644
--- a/contrib/auto_explain/auto_explain.c
+++ b/contrib/auto_explain/auto_explain.c
@@ -29,7 +29,7 @@ static bool auto_explain_log_triggers = false;
static bool auto_explain_log_timing = true;
static int auto_explain_log_format = EXPLAIN_FORMAT_TEXT;
static bool auto_explain_log_nested_statements = false;
-static double auto_explain_sample_ratio = 1;
+static double auto_explain_sample_rate = 1;
static const struct config_enum_entry format_options[] = {
{"text", EXPLAIN_FORMAT_TEXT, false},
@@ -163,10 +163,10 @@ _PG_init(void)
NULL,
NULL);
- DefineCustomRealVariable("auto_explain.sample_ratio",
+ DefineCustomRealVariable("auto_explain.sample_rate",
"Fraction of queries to process.",
NULL,
- &auto_explain_sample_ratio,
+ &auto_explain_sample_rate,
1.0,
0.0,
1.0,
@@ -209,11 +209,11 @@ static void
explain_ExecutorStart(QueryDesc *queryDesc, int eflags)
{
/*
- * For ratio sampling, randomly choose top-level statement. Either
+ * For rate sampling, randomly choose top-level statement. Either
* all nested statements will be explained or none will.
*/
if (auto_explain_log_min_duration >= 0 && nesting_level == 0)
- current_query_sampled = (random() < auto_explain_sample_ratio *
+ current_query_sampled = (random() < auto_explain_sample_rate *
MAX_RANDOM_VALUE);
if (auto_explain_enabled() && current_query_sampled)