Skip to content

The 4D_Info_Report component (formerly called Info Report) is a powerful tool for analyzing and monitoring a running 4D database and its environment, which can help to size the cache, check activated logs or diagnose technical problems such as memory leaks, server misconfigurations, etc.

Notifications You must be signed in to change notification settings

4d/4D_Info_Report

Repository files navigation

Version 4D version Downloads maintenance-status Maintainer
support mac support windows

info_report

About this component?

The component 4D_Info_Report provides a large number of information:

  • about the operating system, the computer and the 4D Application

  • on the database: description of the structure, data file, size, settings, etc.

  • while the server is running, variation of memory, cache usage, connected users, processes, etc.


How to install this component?

There are 2 ways to install this component:

  • 1/ Automatically: using the dependency manager (new 4D feature, available from version 4D 20 R6)
  • 2/ Manually: by copying and pasting the 4D_Info_Report component into the Components folder of the 4D project (works with all versions of 4D)

1/ Automatically

This method requires at least version 20 R6 of 4D

  • Create a dependencies.json file in the /Project/Sources/ folder

  • Copy and paste the text below into this file:

{
	"dependencies": {
		"4D_Info_Report": {
			"github": "4d/4D_Info_Report",
			"version": "20.*"
		}
	}
}
  • Restart 4D or 4D Server, the component will load automatically after reopening the 4D project.

For your information, the component will be downloaded into the:

  • ~/Library/Caches/4D/Dependencies/.github/4d/4D_Info_Report/ (on Mac)
  • ~\AppData\Local\4D\Dependencies\.github\4d\4D_Info_Report\ (on Windows)
  • Follow one of the 2 ways of using the component (see next paragraph) to generate one or more reports

2/ Manually

This method works with all versions of 4D

  • Download the version of the component corresponding to your version of 4D (see the Download or Archives section of this article)

  • Create a Components folder in the 4D project folder (if no such folder exists)

  • Copy the unarchived component to this Components folder

  • Restart 4D or 4D Server

  • Follow one of the 2 ways of using the component below to generate one or more reports


How to use this component?

There are 2 ways to use this component:

  • 1/ Generate reports every N minutes
  • 2/ Generate a report on demand

Reports (text files) are created in a new Folder_reports folder next to the data file.

For each of them, you can use the component:

  • Without modifying the code of the host database: Execute a shared method of the component by manually creating a procedure stored on the server. The advantage is that you don't need to modify the code of the host database, which is particularly useful if the application is deployed in a compiled version, as it avoids recompilation. However, the disadvantage is that you have to run the shared method again after each restart of the 4D server for the stored procedure to be active.
  • By modifying the host database code: This method consists of adding code directly to the host database. It allows you to create the stored procedure automatically when the 4D server starts up, which is very useful for generating reports autonomously and without intervention. This is an "automated" solution, where everything is in place as soon as the server is launched.

Both approaches have their advantages, depending on the context and monitoring needs of the application.

1/ Generate reports every N minutes

Without modifying the host code:

  • Run shared method aa4D_NP_Report_Manage_Display from 4D Remote

  • A component dialog will allow you to start the stored procedure to create a report every N minutes on the 4D server

By modifying the host code:

  • Copy and paste the sample code below into the On server startup database method of your host database:
var $NP : Integer
ARRAY TEXT($at_Components;0)
COMPONENT LIST($at_Components)
If(Find in array($at_Components;"4D_Info_Report@")>0)
  // to start the stored procedure creating report every 5 minutes
  $NP:=New process("aa4D_NP_Schedule_Reports_Server";0;"$4DIR_NP";5;0)
End if

2/ Generate a single report

Without modifying the host code:

  • Create a report by executing the shared method aa4D_NP_Util_CreateReport_Serv

By modifying the host code:

  • Copy and paste the sample code below into your host database:
var $NP : Integer
ARRAY TEXT($at_Components;0)
COMPONENT LIST($at_Components)
If(Find in array($at_Components;"4D_Info_Report@")>0)
  // to create a single report in "Folder_reports" next to the Data file
  $NP:=New process("aa4D_NP_Util_CreateReport_Serv";0;"$4DIR_NP")
End if

How to analyze reports?

You can analyze these reports:

  • from a remote 4D by executing the aa4D_NP_Report_Export_Display method

  • from a single-user 4D by opening the component and clicking on the File / Local reports compare menu


Download


Archives

About

The 4D_Info_Report component (formerly called Info Report) is a powerful tool for analyzing and monitoring a running 4D database and its environment, which can help to size the cache, check activated logs or diagnose technical problems such as memory leaks, server misconfigurations, etc.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages