Introduction
Your app is up and running and you’re wondering if its performance is taking a little longer than it should. To find out what’s slowing it down, you can use a performance recording to evaluate your app. This option can be helpful when troubleshooting and/or optimizing Kepion's performance.
The performance recording feature in Kepion records performance information about key events as users interact with an app. You can then view performance metrics to analyze and troubleshoot different events that are known to affect performance, such as form refreshing and rule execution.
Start performance recording
To start recording the performance, follow this step:
- Modeler > Settings > Select Performance log
- Click Save All
Stop performance recording
It is recommended to stop the performance recording once you capture enough user interactions in the app. To do so, follow this step:
- Modeler > Settings > Unselect Performance log
- Click Save All
Example
You can then use the following queries to analyze the results:
Query performance log data:
SELECT * FROM [dbo].[Log]
SELECT * FROM [dbo].[LogExtension]
SELECT L.[UserID], L.[CreatedOn], L.[Duration], P.* FROM
(
SELECT L.[LogID], [Key], [Value]
FROM [dbo].[LogExtension] LE
INNER JOIN [dbo].[Log] L
ON L.LogID = LE.LogID AND L.Operation = N'Query-Form'
) LE
PIVOT(
MAX([Value])
FOR [Key] IN (
[FormId],
[Query],
[CellCount]
)
) AS P INNER JOIN [dbo].[Log] L
ON L.LogID = P.LogID
SELECT L.[UserID], L.[CreatedOn], L.[Duration], P.* FROM
(
SELECT L.[LogID], [Key], [Value]
FROM [dbo].[LogExtension] LE
INNER JOIN [dbo].[Log] L
ON L.LogID = LE.LogID AND L.Operation = N'Run-Rule'
) LE
PIVOT(
MAX([Value])
FOR [Key] IN (
[SubmissionId],
[RuleId],
[Rule]
)
) AS P INNER JOIN [dbo].[Log] L
ON L.LogID = P.LogID
Filter by results greater than performance threshold
DECLARE @Threshold SMALLINT = 10 --Set performance threshold in seconds
-- GET SLOW FORMS
SELECT DISTINCT
F.[FormName]
FROM Log L
INNER JOIN LogExtension LE ON L.[LogID] = LE.[LogID]
INNER JOIN Forms F ON LE.[Value] = F.[FormID]
INNER JOIN Users U ON L.[UserID] = U.[UserID]
WHERE L.[Duration] > @Threshold
AND L.[Operation] = N'Query-Form'
AND LE.[Key] = N'FormId'
-- GET LOG DETAILS ABOUT SLOW FORMS
SELECT DISTINCT
L.[LogID]
,U.[FullName] [User]
,L.[CreatedOn]
,L.[Duration]
,F.[FormName]
FROM Log L
INNER JOIN LogExtension LE ON L.[LogID] = LE.[LogID]
INNER JOIN Forms F ON LE.[Value] = F.[FormID]
INNER JOIN Users U ON L.[UserID] = U.[UserID]
WHERE L.[Duration] > @Threshold
AND L.[Operation] = N'Query-Form'
AND LE.[Key] = N'FormId'
ORDER BY L.[Duration] DESC
-- GET SLOW RULES
SELECT DISTINCT
R.[RuleName]
FROM Log L
INNER JOIN LogExtension LE ON L.[LogID] = LE.[LogID]
INNER JOIN Rules R ON LE.[Value] = R.[RuleID]
INNER JOIN Users U ON L.[UserID] = U.[UserID]
WHERE L.[Duration] > @Threshold
AND L.[Operation] = N'Run-Rule'
AND LE.[Key] = N'RuleId'
-- GET LOG DETAILS ABOUT SLOW RULES
SELECT DISTINCT
L.[LogID]
,U.[FullName] [User]
,L.[CreatedOn]
,L.[Duration]
,R.[RuleName]
FROM Log L
INNER JOIN LogExtension LE ON L.[LogID] = LE.[LogID]
INNER JOIN Rules R ON LE.[Value] = R.[RuleID]
INNER JOIN Users U ON L.[UserID] = U.[UserID]
WHERE L.[Duration] > @Threshold
AND L.[Operation] = N'Run-Rule'
AND LE.[Key] = N'RuleId'
ORDER BY L.[Duration] DESC
Note: It may take up to 30 seconds for the results to be logged.