Create your own process and user monitoring

Automatically translated from English

You need to get the list of processes running on your 4D server, 4D remote or 4D standalone to create your own Administration Window? You want to know which user initiated each process to create a monitoring window of your application or log this information in a database to analyze later your server load? It is now easy to retrieve this information by programming with a new command: Get process activity.

Monitoring of processes and users

Get process activity is a new 4D command that allows you to retrieve the list of running processes and connected users.

Thanks to this command, you can monitor the server activity from processes and user point of view and easily create this type of process viewer, as provided in our database example:

Database example

Please also note that this feature is a first step to provide you all tools to create your own customized server administration window. Processes and users is a beginning, of course more possibilities will arrive with future R-releases.

Code Examples

The Get process activity command includes two selectors (Processes only and Sessions only) to give the option to the developer to retrieve either the information about the processes only or the information related to users (sessions) only. When no parameter is passed, it returns an object containing 2 collections: processes and sessions.

C_OBJECT($activity)
$activity:=Get process activity  // processes + sessions at once

C_COLLECTION($pCol;$sCol)
$pCol:=$activity.processes
$sCol:=$activity.sessions

Example of information returned in the processes collection:

{
	name:Application process,
	sessionID:4E3F3701DA6E4C449513D11FB68AA01C,
	number:4,
	ID:4,
	visible:true,
	type:-18,
	state:2,
	cpuUsage:0.022585061256626,
	cpuTime:8.1486859585647,
	preemptive:false
},
{
	name:DB4D Flush,
	state:0,
	cpuUsage:0,
	cpuTime:0,
	preemptive:true
},
(...)

Example of information returned in the sessions collection:

{
	type:remote,
	userName:Designer,
	machineName:VM10-MAINGUENE,
	systemUserName:fmainguene,
	IPAddress:localhost,
	creationDateTime:2017-04-26T07:59:27Z,
	state:active,
	ID:4E3F3701DA6E4C449513D11FB68AA01C
}
Fabrice Mainguené

• Product Owner •

Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.

After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.