diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-27 13:48:12 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-27 13:48:12 +0100 |
commit | 6182e51efa30851849901b70b9128bb07adf0418 (patch) | |
tree | 33dd44c9a40cae7621c601f8c3e070f759ae0319 | |
parent | ab5782459739c7b51333ef592a26ee583bf1d057 (diff) | |
parent | 20cc0ac7a036babd3bc9ff87e41dc937a7942931 (diff) |
Merge pull request #2040 from keszybz/randomized-delay
core: rename Random* to RandomizedDelay*
-rw-r--r-- | man/systemd.timer.xml | 14 | ||||
-rw-r--r-- | src/core/dbus-timer.c | 6 | ||||
-rw-r--r-- | src/core/load-fragment-gperf.gperf.m4 | 2 | ||||
-rw-r--r-- | src/shared/bus-util.c | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/man/systemd.timer.xml b/man/systemd.timer.xml index fd03bda9cd..cfa13015b0 100644 --- a/man/systemd.timer.xml +++ b/man/systemd.timer.xml @@ -205,7 +205,7 @@ </varlistentry> <varlistentry> - <term><varname>RandomSec=</varname></term> + <term><varname>RandomizedDelaySec=</varname></term> <listitem><para>Delay the timer by a randomly selected, evenly distributed amount of time between 0 and the specified time @@ -222,16 +222,16 @@ time range in order to minimize wakeups, the former does the opposite: it stretches timer events over a time range, to make it unlikely that they fire simultaneously. If - <varname>RandomSec=</varname> and + <varname>RandomizedDelaySec=</varname> and <varname>AccuracySec=</varname> are used in conjunction, first - the a randomized time is added, and the result is then - possibly shifted further to coalesce it with other timer - events possibly happening on the system. As mentioned above + the randomized delay is added, and then the result is + possibly further shifted to coalesce it with other timer + events happening on the system. As mentioned above <varname>AccuracySec=</varname> defaults to 1min and - <varname>RandomSec=</varname> to 0, thus encouraging + <varname>RandomizedDelaySec=</varname> to 0, thus encouraging coalescing of timer events. In order to optimally stretch timer events over a certain range of time, make sure to set - <varname>RandomSec=</varname> to a higher value, and + <varname>RandomizedDelaySec=</varname> to a higher value, and <varname>AccuracySec=1us</varname>.</para></listitem> </varlistentry> diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c index 4bee82df07..ec301df6d7 100644 --- a/src/core/dbus-timer.c +++ b/src/core/dbus-timer.c @@ -180,7 +180,7 @@ const sd_bus_vtable bus_timer_vtable[] = { BUS_PROPERTY_DUAL_TIMESTAMP("LastTriggerUSec", offsetof(Timer, last_trigger), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Timer, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("AccuracyUSec", "t", bus_property_get_usec, offsetof(Timer, accuracy_usec), SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("RandomUSec", "t", bus_property_get_usec, offsetof(Timer, random_usec), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("RandomizedDelayUSec", "t", bus_property_get_usec, offsetof(Timer, random_usec), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("Persistent", "b", bus_property_get_bool, offsetof(Timer, persistent), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("WakeSystem", "b", bus_property_get_bool, offsetof(Timer, wake_system), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("RemainAfterElapse", "b", bus_property_get_bool, offsetof(Timer, remain_after_elapse), SD_BUS_VTABLE_PROPERTY_CONST), @@ -284,7 +284,7 @@ static int bus_timer_set_transient_property( return 1; - } else if (streq(name, "RandomUSec")) { + } else if (streq(name, "RandomizedDelayUSec")) { usec_t u = 0; r = sd_bus_message_read(message, "t", &u); @@ -295,7 +295,7 @@ static int bus_timer_set_transient_property( char time[FORMAT_TIMESPAN_MAX]; t->random_usec = u; - unit_write_drop_in_private_format(UNIT(t), mode, name, "RandomSec=%s\n", format_timespan(time, sizeof(time), u, USEC_PER_MSEC)); + unit_write_drop_in_private_format(UNIT(t), mode, name, "RandomizedDelaySec=%s\n", format_timespan(time, sizeof(time), u, USEC_PER_MSEC)); } return 1; diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4 index c64850802e..0408b9a829 100644 --- a/src/core/load-fragment-gperf.gperf.m4 +++ b/src/core/load-fragment-gperf.gperf.m4 @@ -347,7 +347,7 @@ Timer.Persistent, config_parse_bool, 0, Timer.WakeSystem, config_parse_bool, 0, offsetof(Timer, wake_system) Timer.RemainAfterElapse, config_parse_bool, 0, offsetof(Timer, remain_after_elapse) Timer.AccuracySec, config_parse_sec, 0, offsetof(Timer, accuracy_usec) -Timer.RandomSec, config_parse_sec, 0, offsetof(Timer, random_usec) +Timer.RandomizedDelaySec, config_parse_sec, 0, offsetof(Timer, random_usec) Timer.Unit, config_parse_trigger_unit, 0, 0 m4_dnl Path.PathExists, config_parse_path_spec, 0, 0 diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 38281045b8..8775808da4 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1443,14 +1443,14 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen return 0; - } else if (streq(field, "RandomSec")) { + } else if (streq(field, "RandomizedDelaySec")) { usec_t t; r = parse_sec(eq, &t); if (r < 0) - return log_error_errno(r, "Failed to parse RandomSec= parameter: %s", eq); + return log_error_errno(r, "Failed to parse RandomizedDelaySec= parameter: %s", eq); - r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, "RandomUSec"); + r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, "RandomizedDelayUSec"); if (r < 0) return bus_log_create_error(r); |