I guess that the problem with session_id is that it will also count the spiders, etc (I mean, everything accessing the site).
Something like:
set ten_min_ago [expr [ns_time] - (10*60)]
set sql_query "select count(distinct session_id)
as result from sec_session_properties where last_hit > :ten_min_ago"
db_1row select_sessions $sql_query
should give you some sessions. The only issue that I see is that, at least in OpenACS 4.6.3 (that's what we are using at the moment) you don't have an index on
sec_session_properties(last_hit) so this query is quite inefficient (but I am not sure than adding an index is also a good solution, this table is touched a lot -for every hit, right?-).
Just my 2 cents,
/B