NanoProfiler

Content Type: Module
Categories: Tracing

Overview

A simple and lightweight profiling tool. It provides a function to easily measure the processing time in Microflow with a small footprint.

Documentation

Description

NanoProfiler is a module for measuring the elapsed time of any section in your Microflow with a small footprint.
It all works on-memory and doesn't use any Mendix Entity, so it's lightweight and fast.

Typical usage scenario

-To detect bottlenecks when tuning Microflow.
-To monitor Microflow’s performance during operation.

Features and limitations

StartNanoProfiler Action
Start the profiler. 
You can create multiple profilers and use them at the same time. In that case, identify it with the handle returned by this Action.

TickNanoProfiler Action
Profile point name, elapsed time and number of calls.
If an empty string (not empty but empty string) is specified as the handle and there is only one profiler started, it will be recorded in that profiler.
This Action took only 19 microseconds each time measured with Mendix 8.12.7 on i7-10610U laptop. As a reference, an empty Java Action took 16 microseconds on the same measurement.

LogNanoProfileAsInfo/Debug/Trace Action
Output profile results to logger as Info/Debug/Trace like below.
The total processing time between each point recorded by Tick Action is output to the log. Please note that the unit is nanoseconds. 1,000,000 nanoseconds is 1 millisecond. SectionName is a concatenation of pointName specified in TickAction.
### NanoProfiler Report: profileName=ACT_Sample : totalTicks = 59 : totalNanos = 8,953,800
#### sectionName = Start ACT_Sample-After Logging : executedCount = 1 : accumulatedNanos = 62,600 : averageNanos = 62,600
#### sectionName = After Logging-After Retrieve User : executedCount = 1 : accumulatedNanos = 3,605,700 : averageNanos = 3,605,700
#### sectionName = After Retrieve User-Start Loop Process : executedCount = 1 : accumulatedNanos = 188,700 : averageNanos = 188,700
#### sectionName = Start Loop Process-Enter SUB_Sample : executedCount = 14 : accumulatedNanos = 1,595,100 : averageNanos = 113,935
#### sectionName = Enter SUB_Sample-Leave SUB_Sample : executedCount = 14 : accumulatedNanos = 1,217,300 : averageNanos = 86,950
#### sectionName = Leave SUB_Sample-End Loop Process : executedCount = 14 : accumulatedNanos = 740,800 : averageNanos = 52,914
#### sectionName = End Loop Process-Start Loop Process : executedCount = 13 : accumulatedNanos = 1,481,600 : averageNanos = 113,969
#### sectionName = End Loop Process-END ACT_Sample : executedCount = 1 : accumulatedNanos = 62,000 : averageNanos = 62,000

StopNanoProfiler Action
Stop the profiler. 
This module has a mechanism to automatically release the related internal resource after the reference to Handle returned by StartNanoProfiler Action is lost, but it is usually recommended to explicitly stop and release the resource. 

Dependencies

- There is no dependency on other modules.
- About Mendix modeler version, you can see it on Usage section.

Installation

You can download and install the module from the App Store on Studio Pro in the regular way.

Configuration

Add the NanoProfiler action to the Microflow you want to measure by referring to the sample image.

Known bugs

There is no known bugs.

 

Releases

Version: 1.0.1
Framework Version: 8.12.7
Release Notes: Added total tick count to log.
Version: 1.0.0
Framework Version: 8.12.7
Release Notes: First release.