960 @verb #9852:"@dbinfo" none none none rdo #9852 @program #9852:"@dbinfo" none none none "@dbinfo" "display a list of database information. Used to use $console, but now just looks like it does, because $console is kind of slow and isn't on all moos." "" "Hmm: When I get around it, @dbinfo will be more flexible" invalid = 0 wait = `$login:current_lag() ! E_VERBNF => 1' * 3 + 1 for h in [#0..max_object()] $command_utils:suspend_if_needed(wait) if (!valid(h)) invalid = invalid + 1 endif endfor cpw = 0 aweekago = time() - 60 * 60 * 24 * 7 for h in (players()) $command_utils:suspend_if_needed(wait) if (`h.last_disconnect_time > aweekago && h.last_disconnect_time < time() || h:is_listening(h) ! E_PROPNF => 0') cpw = cpw + 1 endif endfor suspend(0) meg = tofloat(1024 * 1024) title = `$network.moo_name ! E_PROPNF => ""' + " statistics" fo = {} fo = {@fo, {"Core age: ", `$time_utils:english_time(time() - $core_history[1][3]) ! ANY => "Unknown"'}} fo = {@fo, {"Core creation:", `ctime($core_history[1][3]) ! ANY => "Unknown"'}} fo = {@fo, {"Server Version:", tostr("Lambda Server ", server_version())}} fo = {@fo, {"Database Size:", tostr($string_utils:group_number(db_disk_size()), " (", floatstr(tofloat(db_disk_size()) / meg, 2), " MB)")}} fo = {@fo, {"Rooms:", length($object_utils:descendants($room))}} fo = {@fo, {"Players:", length(players())}} fo = {@fo, {"Recently connected:", tostr(cpw, " (", floatstr(tofloat(cpw) / tofloat(length(players())) * 100.0, 1), "%)")}} "some moos use invalid $recyclers." fo = {@fo, {"Garbage Objects:", length(`children($garbage) ! ANY => {}')}} fo = {@fo, {"Invalid objects:", invalid}} fo = {@fo, {"Max Object:", $string_utils:nn(max_object())}} fo = {@fo, {"Server Uptime:", tostr($time_utils:english_time(time() - $last_restart_time))}} player:tell("") suspend(0) "===show===" player:tell(title) ll = player:linelen() - 1 ine = $string_utils:space(ll, "-") player:tell(ine) m = 20 n = ll - m m = -m n = -n for h in (fo) player:Tell($string_utils:left(h[1], -m), $string_utils:left(h[2], -n)) $command_utils:suspend_if_needed(0) endfor player:tell(ine) "And if you decide to read my code:" "Created by End@WebMOO (webmoo.cjb.net 7000)" return "Last Modified By: End (#96) Sat Dec 22 16:30:53 2001 MST" "Last modified by End (#9852) on Wed Dec 26 16:22:01 2001 MST." . 0