How to tell if MiServer is in active use

MiServer is Dyalog's APL-based web development framework

How to tell if MiServer is in active use

Postby ray on Mon Sep 21, 2020 1:46 pm

Currently, I have a MiServer project (called "Hex") being hosted on my home PC.

In the Dyalog session running MiServer (version 3.1.1661) I put out a message when somebody start running "Hex", and when the HTML and data files are sent to the user's browser.

"Hex" uses AJax (via APLJax) to communicate between my PC and the user's browser. At times, in excess of 6 messages a second are being transferred, so it is NOT appropriate to write to the APL session log each time this a message is sent.

From the Dyalog APL session, is there any way to see how many ACTIVE MiServer "Hex" sessions are (still) active or when the last message in each session was sent?
How can I tell that there are no more active Hex sessions running?
Ray Cannon
Please excuse any smelling pisstakes.
User avatar
ray
 
Posts: 167
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK

Re: How to tell if MiServer is in active use

Postby ray on Tue Sep 22, 2020 4:59 pm

As a temporary fix, I now write a log message every 1000 APLJax events.

This writes a new message every 40 seconds or so, which is currently manageable.
127.0.0.1:56227 2020 9 22 17 33 37 370 World data file:c:/misites/hex/sample4.world.data
127.0.0.1:56227 2020 9 22 17 33 48 132 JavaScript file:c:/misites/hex/hex_script.js
127.0.0.1:56227 2020 9 22 17 33 48 832 Annimation file:c:/misites/hex/sample4.world.data.svg
127.0.0.1:56227 2020 9 22 17 33 48 842 HTML and data files sent to Browser
127.0.0.1:56270 2020 9 22 17 33 51 988 Ants are up and running!
127.0.0.1:56270 2020 9 22 17 34 18 662 Watch event
127.0.0.1:56270 2020 9 22 17 34 18 672 Ant watched changed
127.0.0.1:56270 2020 9 22 17 34 54 167 Ants still running,1000
127.0.0.1:56270 2020 9 22 17 35 41 835 Ants still running,2000
127.0.0.1:56270 2020 9 22 17 36 26 393 Ants still running,3000
127.0.0.1:56270 2020 9 22 17 37 10 568 Ants still running,4000
127.0.0.1:56270 2020 9 22 17 37 54 880 Ants still running,5000
127.0.0.1:56270 2020 9 22 17 38 38 188 Ants still running,6000

I might end up sending these message to a log file rather than the APL developers session, but then at some stage I will have to remove old log files.
Ray Cannon
Please excuse any smelling pisstakes.
User avatar
ray
 
Posts: 167
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK

Re: How to tell if MiServer is in active use

Postby Brian|Dyalog on Wed Sep 23, 2020 4:48 am

Hi Ray,

If you have sessions turned on (and you do, I checked :)), then you can see the last time each session was active by examining #.Boot.ms.SessionHandler.Sessions.LastActive. This will return an extended IDN for when the session last serviced a request. You can convert the extended IDN to ⎕TS format with ¯1 ⎕DT or #.Dates.IDNToDate.

I hope this helps!

/Brian
User avatar
Brian|Dyalog
 
Posts: 101
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY

Re: How to tell if MiServer is in active use

Postby ray on Wed Sep 23, 2020 6:45 pm

Thank you Brian, this is exactly the information I needed!
Ray Cannon
Please excuse any smelling pisstakes.
User avatar
ray
 
Posts: 167
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK


Return to MiServer

Who is online

Users browsing this forum: No registered users and 1 guest