Simple Performance Metrics

Samples and Examples of using the Jiwa 7 framework - including plugins, stand-alone applications and scripts.

Simple Performance Metrics

Postby Mike.Sheen » Wed Sep 16, 2015 7:55 pm

This plugin is something I whipped up to try and isolate performance issues. Sometimes users complain of operations "being slow", but it's hard to get quantifiable data on what is slow, so this plugin logs to a table the time taken to read and save within the business logic of Maintenance type forms.

Installation steps:

  • Import the plugin
  • Save the plugin
  • Run the SQL script (attached as a document to the plugin - right click on the document and select "open" to run in Management Studio - don't forget to select the right database!)
  • Quit Jiwa, and login again
  • Open Menu Maintenance and add the "Performance Metrics" form to the desired menu(s).

When adding to the menu, sort the forms by type to quickly see the plugin forms as there are many forms, and then just drag and drop onto the desired location of the menu.
PerformanceMetricsMenu.PNG
Adding the new form to the menu


Once done, you will see on your menu the new form - opening it will reveal something like this:
PerformanceMetricsForm.PNG
Performance Metrics Form
PerformanceMetricsForm.PNG (39.86 KiB) Viewed 2238 times


Using the refresh button will re-load the data from the metrics table. Now we can see which users are doing what, and how long these operations are taking - useful in helping anyone trying to hone in on performance issues. The "Document No." column is drill-able, so if you spot something taking an inordinate amount of time, you can quickly and easily drill to that very item yourself to see if you experience the same issue.

One thing which may be of interest is that the form was built using just a few lines of code - this form inherits from the ""Navigation List" base form, which is simply a grid and populates itself entirely from a given stored procedure:

Code: Select all
public class PerformanceMetricsForm : JiwaFinancials.Jiwa.JiwaApplication.NavigationListUI.NavigationList
{
   public PerformanceMetricsForm()
   {
      base.StoredProcName = "usp_JIWA_NavigationList_PerformanceMetrics";
      base.Text = "Performance Metrics";
   }
}


It is possible to pass parameters to the stored procedure as well, but in this sample I didn't need any. But as an example, here is how you could pass the current staff member and the current login date by adding to the PerformanceMetricsForm() constructor above:

Code: Select all
SqlClient.SqlParameter newSQLParameter2 = new SqlClient.SqlParameter("@HR_Staff_StaffID", SqlDbType.Char)  {Value = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Staff.RecID};
base.SQLParameters.Add(newSQLParameter1);

SqlClient.SqlParameter newSQLParameter2 = new SqlClient.SqlParameter("@AsAtDate", SqlDbType.DateTime)  {Value = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.SysDateTime};
base.SQLParameters.Add(newSQLParameter2);


The above would rely on the stored procedure having parameters named @HR_Staff_StaffID and @AsAtDate. So, you can probably see how you can quickly build a form based off a dataset returned by a stored procedure - complete with drill-downs!

Attached is the plugin:
Plugin Performance Metrics.xml
Performance Metrics Plugin
(44.58 KiB) Downloaded 313 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Simple Performance Metrics

Postby Mike.Sheen » Sat Mar 12, 2016 3:10 pm

I've updated this plugin to include a report - it's a document attachment to the plugin.

You'll need to export the document, then import the report and add it to the menu. It depends on a stored procedure which is in the SQL script attached to the plugin.

The report is pretty simple - it shows a graph of the average response times in milliseconds for a given date range

PerformanceMetricsReport.PNG
Report


We were particularly interested in this as we've been making improvements over time to Jiwa to make it more responsive when using the Azure platform. Every build of Jiwa we do, we apply this to our own internal implementation of Jiwa which is using an Azure SQL database and Azure RemoteApp. The above graph shows the continual improvement over time.

There are some outliers in the graph, which mostly is explained by the use of Outlook to send emails. About a week ago we changed our email mechanism to use the Office365 REST API instead, and have seen those outliers diminish.

Notable changes we've made to make the software more responsive on Azure:
  • Connection Resilience
  • Transient Fault tolerance
  • Asynchronous saves and reads
  • Asynchronous emailing when using Office365 REST API

Another change we made was to move to the S2 service tier from S0 for the Azure SQL database.
Attachments
Plugin Performance Metrics.xml
Updated plugin
(172.63 KiB) Downloaded 263 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Simple Performance Metrics

Postby Mike.Sheen » Fri Feb 14, 2020 5:00 pm

Updated to address an issue where if loaded twice, the two forms would interfere with each other.
Attachments
Plugin Performance Metrics 7.2.1.1.xml
(167.31 KiB) Downloaded 81 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Simple Performance Metrics

Postby Mike.Sheen » Wed Feb 19, 2020 1:22 pm

Updated to clean up code a bit - removed duplicate logging method, used generic helper methods to get and set GenericObjectCollection item contents.
Attachments
Plugin Performance Metrics 7.2.1.2.xml
(163.79 KiB) Downloaded 77 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755


Return to Samples and Examples

Who is online

Users browsing this forum: No registered users and 1 guest

cron