Dashboard Modification - show relevance evaluation time

(imported topic written by MacDaddyNeal91)

Greetings.

I am working on modifying our dashboard to show the relevance evaluation runtime. We have customized our dashboard and I have been tasked with trying to optimize the relevance to speed up the refresh time.

I’m thinking that I may have to write a timer function to calculate the start time, stop time and then the difference. and then call this function prior to each relevance statement and then again at the conclusion of each relevance statement.

Does anyone know if BF has this ability built-in already? For example the following relevance from the dashboard is used to return the AD distinguished name for the client:

<?relevance if (exists key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine" of registry ) then (if (exists((value "Distinguished-Name" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine" of registry) as string)) then (if (exists((value "Distinguished-Name" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine" of registry) as string)) then ((concatenation " / " of (substrings separated by "," of (following text of first "," of ((value "Distinguished-Name" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine" of registry) as string))))) else ("N/A")) else ("N/A")) else ("N/A") ?>

What I am looking for is to append to the relevance answer something like " (364.28 ms)" to let me know how long it took to determine the answer to the relevance.

Thoughts, suggestions, ideas?

(imported comment written by Lee Wei)

This is what I do in JavaScript.

var startTimeReport; var endTimeReport;   startTimeReport = 

new Date().getTime();   
// Your relevance statement here using the EvaluateRelevance() JavaScript function.   endTimeReport = 

new Date().getTime(); document.getElementById(
'TimeStampDiv').innerHTML = 
'<br>Generated on: ' +  CurrentTime.format(
'M jS, Y g:iA T') + 
'  <br>Elapsed time for report: ' + ((endTimeReport-startTimeReport)/1000)       + 
' seconds.';

Lee Wei

(imported comment written by SystemAdmin)

Lee Wei

This is what I do in JavaScript.

var startTimeReport; var endTimeReport; startTimeReport =

new Date().getTime();
// Your relevance statement here using the EvaluateRelevance() JavaScript function. endTimeReport =

new Date().getTime(); document.getElementById(
‘TimeStampDiv’).innerHTML =

Generated on: ’ + CurrentTime.format(
‘M jS, Y g:iA T’) +

Elapsed time for report: ’ + ((endTimeReport-startTimeReport)/1000) +
’ seconds.’;

Lee Wei

This is good code, except Neal was asking how to do this in a client dashboard. I believe it to be nearly impossible as the EvaluateRelevance() function is not available in the client dashboard. Instead, the relevance must be embedded in <?relevance ?> tags for the dashboard interpeter.

I feel this is the one major flaw in the design of the dashboard.

Is there a way, with the relevance language itself, to get the response time of a query?