<% ## Nasty-cheap authenticator. if {[ns_conn authuser] != "nsadmin" || [ns_conn authpassword] != "x"} { ns_returnunauthorized ns_adp_break } ## Expires: now ns_set update [ns_conn outputheaders] "Expires" "now" %> AOLserver Telemetry <% ## For Tcl procs: display proc body and immediately return. if { [ns_queryget "tclproc"] != "" } { set tclproc [ns_queryget tclproc] set procbody [info body $tclproc] ns_puts "

Tcl Proc: $tclproc

$tclproc [info args $tclproc]
" ns_adp_return } %>

AOLserver Telemetry

$Header: /cvsroot/aolserver/aolserver/tests/nstelemetry.adp,v 1.1 2000/10/09 20:29:54 kriston Exp $
This is nstelemetry running at <%=[ns_conn url]%> on <%=[ns_conn server]%> at <%=[ns_httptime [ns_time]]%>.
For easier reading of these data your browser should support Style Sheets at least as well as Netscape 4.x does -- MSIE 5.5 users will see inconsistencies.

Server Information

<% ## Server information. ## Things that don't go here: threads, callbacks, scheduled, sockcallbacks foreach item { server hostname address pid uptime boottime home config log pageroot tcllib nsd argv0 name version label builddate platform } { ## Note the catch so this works on all AOLserver revisions. if [catch { set itemval [ns_info $item] if [regexp {boottime} $item] { set itemval "[ns_httptime $itemval]" } ns_puts "" } errMsg] { ## Catch commands that don't exist. ns_puts "" continue } } %>
$item: $itemval  
$item:n/a

Memory Cache

<% foreach item [lsort [ns_cache_names]] { ns_puts "" ns_puts "" } %>
name stats
$item[ns_cache_stats $item] 

Thread Locks

<% foreach item [lsort [ns_info locks]] { ns_puts "" ns_puts "" for { set i 1 } { $i < [llength $item] } { incr i } { ns_puts "" } ns_puts "" } %>
name owner id nlock nbusy
[lindex $item 0]  [lindex $item $i]

Running Threads

<% foreach item [lsort [ns_info threads]] { ns_puts "" for { set i 0 } { $i < 7 } { incr i } { ns_puts "" } ns_puts "" } %>
name parent tid flags ctime proc arg
"
	if { $i != 4 } {
	    ns_puts "[lindex $item $i]"
	} else {
	    ns_puts "[ns_httptime [lindex $item $i]]"
	}
	ns_puts "

Scheduled Procedures

<% foreach item [lsort [ns_info scheduled]] { ns_puts "" ## proc, id, flags, interval ns_puts "" for { set i 0 } { $i < 3 } { incr i } { ns_puts "" } ## times: nextqueue, lastqueue, laststart, lastend ns_puts "" ## arg ns_puts "" ns_puts "" } %>
proc id flags interval nextqueue
lastqueue
laststart
lastend
arg
[lindex $item 7] [lindex $item $i] 
"
    for { set i 3 } { $i < 7 } { incr i } {
	ns_puts "[ns_httptime [lindex $item $i]]"
    }
    ns_puts "
[lindex $item 8] 

Connections (web clients)

<% foreach item { connections waiting queued keepalive } { ns_puts "" ns_puts "" } %>
$item: [ns_server $item]

Callbacks -- Events

<% foreach item [lsort [ns_info callbacks]] { ns_puts "" for { set i 0 } { $i < 3 } { incr i } { ns_puts "" } ns_puts "" } %>
event name arg
[lindex $item $i] 

Callbacks -- Sockets (sockcallbacks)

<% foreach item [lsort [ns_info sockcallbacks]] { ns_puts "" for { set i 0 } { $i < 4 } { incr i } { ns_puts "" } ns_puts "" } %>
sock id when proc arg
[lindex $item $i]

URL Stats

<% foreach item [lsort [ns_server urlstats]] { ns_puts "" ns_puts "" ns_puts "" for { set i 2 } { $i < 8 } { incr i; incr i} { if { [set thistime [lindex [lindex $item 1] $i]] != "" } { ns_puts " " } else { ns_puts "" } } ns_puts "" } %>
url hits wait (sec) open (sec) closed (sec)
[lindex $item 0]  [lindex [lindex $item 1] 0] [format "%.6f" [expr $thistime * .000001]] 

Script and Server Errors

Coming soon: Reports of 400- and 500-series errors.

Configuration

Coming soon: Dump of parsed configuration data.

Tcl Information -- Tcl Core

<% ## Tcl library information. foreach item { tclversion patchlevel level nameofexecutable sharedlibextension library} { ns_puts "" ns_puts "" } %>
$item:[info $item]

Tcl Information -- Procs (Tcl language)

<% foreach item [lsort [info procs]] { ns_puts "$item  " } %>

Tcl Information -- Commands (C and Tcl language)

<% foreach item [lsort [info commands]] { ns_puts "${item} " } %>

HTTP Headers

<%
for { set i 0 } { $i < [ns_set size [ns_conn headers]] } { incr i } {
    ns_puts "[ns_set key [ns_conn headers] $i]: [ns_set \
                value [ns_conn headers] $i]"
}
%>

Server Log

<% if [regexp {STDOUT} [ns_info log]] { ns_puts "Log is on stdout and cannot be viewed from here." ns_puts "" ns_adp_return } %> <% if { [set logsize [ns_queryget logsize]] == "" } { set logsize 50000 } %> Last <%=$logsize%> bytes of server log <%=[ns_info log]%>.
>