NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Wolfgang Orth on July 21, 2017, 01:07:26 AM
-
Hello Bruce and all others,
the Webserver has all those pretty values in the WebPerfomance GROUP shown on the window of my server, however, when run as a Service, I can't make any use of them. my question now is, how can I access those variables in MAIN from inside a Servicemethos, so that I can send them back as return values or alternatively make an HTML-page from those performance data?
Thanks in advance
Wolfgang
-
Wolfgang, there is indeed a hidden gem in example 34 Calculator (34). When you open the example there is a Performance (NetWebForm) procedure that is not available by the menu options when you compile but, if you write /Performance (after the URL) you see something like the image below.
Hope this helps.
Cheers @ Urayoan
-
Example 34 !! Thanks Ura.
I knew I did it for one of the examples, but I couldn't remember which one.
I need to update it though so it uses websockets rather than a timer...
cheers
Bruce
-
Great tip, urayoan!
Works perfect!
On the Server-side (SOAP), I put this into the Embed "ServiceMethod":
WebPerformance = p_web.RequestData.Webserver.Performance
where WebPerformance is a defined GROUP, which is my ReturnValue.
On the Client-side I do a simple WebClient.POST() and in WebClient.Pagereceived I wrote this:
xmlPerformanceData.load(WebPerformance ,self.page, len(clip(self.page)), '', 'WebPerformance')
For anyone, who wants to do the same, here is the GROUP:
WebPerformance GROUP,PRE(wp)
StartDateA LONG,NAME('StartDateA')
StartTimeA LONG,NAME('StartTimeA')
NumberOfRequests LONG,NAME('NumberOfRequests')
NumberOfSpiderRequests LONG,NAME('NumberOfSpiderRequests')
NumberOf404Requests LONG,NAME('NumberOfSpiderRequests')
NumberOf500Requests LONG,NAME('NumberOf404Requests')
TotalRequestTime REAL,NAME('TotalRequestTime')
NumberOfRequestsLTHalf LONG,NAME('NumberOfRequestsLTHalf')
NumberOfRequestsLTOne LONG,NAME('NumberOfRequestsLTOne')
NumberOfRequestsLTTwo LONG,NAME('NumberOfRequestsLTTwo')
NumberOfRequestsLTFive LONG,NAME('NumberOfRequestsLTFive')
NumberOfRequestsGTFive LONG,NAME('NumberOfRequestsGTFive')
RequestTimeLTHalf REAL,NAME('RequestTimeLTHalf')
RequestTimeLTOne REAL,NAME('RequestTimeLTOne')
RequestTimeLTTwo REAL,NAME('RequestTimeLTOne')
RequestTimeLTFive REAL,NAME('RequestTimeLTFive')
RequestTimeGTFive REAL,NAME('RequestTimeGTFive')
AverageRequestTimeLTHalf REAL,NAME('AverageRequestTimeLTHalf')
AverageRequestTimeLTOne REAL,NAME('AverageRequestTimeLTOne')
AverageRequestTimeLTTwo REAL,NAME('AverageRequestTimeLTTwo')
AverageRequestTimeLTFive REAL,NAME('AverageRequestTimeLTFive')
AverageRequestTimeGTFive REAL,NAME('AverageRequestTimeGTFive')
MaximumThreads LONG,NAME('MaximumThreads')
MaximumSessions LONG,NAME('MaximumSessions')
MaximumSessionData LONG,NAME('MaximumSessionData')
MaximumThreadPool LONG,NAME('MaximumThreadPool')
NumberOfSessions LONG,NAME('NumberOfSessions')
NumberOfSessionData LONG,NAME('NumberOfSessionData')
NumberOfThreads LONG,NAME('NumberOfThreads')
NumberOfThreadPool LONG,NAME('NumberOfThreadPool')
END
You can simply copy and paste it either into the DATA-Embed or directly into the DATA-PAD, if you prefer.
Thanks again!
bye
Wolfgang
-
Nice! Thank you Wolfgang
-
Example 34 !! Thanks Ura.
I knew I did it for one of the examples, but I couldn't remember which one.
I need to update it though so it uses websockets rather than a timer...
cheers
Bruce
That would be great Bruce. Cheers!