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.
Once done, you will see on your menu the new form - opening it will reveal something like this:
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: