MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: checkpoints



All this talk about checkpoint notifications reminded me of something I
wrote a while ago and was planning to make public but never got around to
it.  So, if anyone wants the code, just mail me and I'll send you a @dump.

Features:
  * Allows players to turn checkpoint notification on or off.  Checkpoint
    notification looks something like this:

    [Checkpointer]  Started at Fri Sep 20 16:28:54 1996 CDT, it should take
    about a minute and cause 0.01 seconds of lag.
  (the approximate time and lag are averages of the last few checkpoints and
  are updated automatically)
  ...
    [Checkpointer]  Finished at Fri Sep 20 16:30:13 1996 CDT and took 1 minute
    and 19 seconds.  The DB size was 1,766,771 bytes.  It grew 1,643 bytes in
    approximately 16 hours (1 byte/minute).  The checkpoint caused 0 seconds
    of lag.

  * Setting an alternate message for players with their checkpoint
    notification turned off.

  * It keeps track of the last few (default is 10) checkpoints and stores
    information about them (time they occurred, size, how long they take,
    and how much lag they cause).

  * It can do checkpoint scheduling in-DB which allows players to be warned
    of checkpoints in advance (the amount of warning each player recieves is
    customizable with @notify-ch warn), along with allowing wizards (or anyone
    in $checkpointer.trusted) to cancel checkpoints, schedule new checkpoints,
    change the dump interval w/o having to wait for the server to schedule
    another one, use a different dump interval if the previous checkpoint
    failed, etc.

  * Keeps track of the last time the database was saved (including crashes).

  * Warning players when the MOO hasn't successfully checkpointed recently.

  * Calling a verb on certain objects to give them time to 'prepare' for the
    checkpoint (so FUPed databases can load the temporary information back
    into the database to be included in the checkpoint, in case the server
    crashes and the disk information is newer than the database).

Anyway, it's implemented as a $feature, requiring only one core verb to be
hacked (#0:"checkpoint_started checkpoint_finished" has to be hacked to do
$checkpointer:(verb)(@args)).

Here's the help message:

Checkpointer (#122):
----
This is a utility object used to checkpoint the MOO's database at regular
intervals.

#122:@checkpoint
Usage: @checkpoint                 -- Schedule a checkpoint in one minute
       @checkpoint now             -- Checkpoint immediately
       @checkpoint cancel          -- Cancel the next checkpoint
       @checkpoint in <interval>   -- Schedule a checkpoint in <interval>
       @checkpoint at <time>       -- Schedule a checkpoint at <time>
"@checkpoint now" is equivalent to $wiz:@dump-d, the rest schedule
a checkpoint as long as there isn't already one scheduled before then.
See "help $time_utils:parse_english_time_interval" for the format of
<interval> and <time> is in the format hh:mm[:ss] [am | pm].

#122:@status-ch*eckpoint
Usage: @status-checkpoint
Shows:
  How long until the next time a checkpoint occurs.
  How long since the database was last saved.
  If a checkpoint is currently already in progress, how long until it finishes.
  The checkpoint interval and failed checkpoint interval.
  The average duration for checkpoints and how much lag they cause.
  The database size, as of the last checkpoint.

#122:@notify-ch*eckpoint
Usage: @notify-checkpoint             -- Shows your current settings.
       @notify-checkpoint on          -- Notify you of all checkpoints.
       @notify-checkpoint off         -- Stop notifying you of checkpoints.
       @notify-checkpoint warn [time] -- Give you <time> amount of warning
                                      before a checkpoint.  See
                                      $time_utils:parse_english_time_interval
                                      for the format of <time>.

#122:@list-ch*eckpoints
Usage:  @list-checkpoints
Lists the data saved for the last few checkpoints.
----


References:

Home | Subject Index | Thread Index