Nueva publicación

Encontrar

Pregunta
· 19 mayo, 2025

BI Analytics default key:value pair in termlist

I have a widget that uses "choose Data source" control option. Termlist for the control consist of the two data sources and i want to set one of them by default. For example: I have two data sources, one is grouped by month, the other by year. I need to set the one that is grouped by year by default 

Using default value at the bottom return an error

How can i achive that?

 

2 comentarios
Comentarios (2)2
Inicie sesión o regístrese para continuar
Artículo
· 19 mayo, 2025 Lectura de 2 min

Usar %System.Monitor.LineByLine junto con %SYS.MONLBL para analizar vuestro código

Estoy seguro de que la mayoría de vosotros estáis familiarizados con la utilidad %SYS.MONLBL, que es crucial cuando se analizan los cuellos de botella de rendimiento del código. Permite seleccionar un número de rutinas que queréis monitorizar en tiempo de ejecución y también especificar qué proceso(s) queréis observar. PERO, ¿qué pasa si no sabéis exactamente qué proceso ejecutará vuestro código? Esto es común en muchas aplicaciones basadas en la web (CSP/REST) hoy en día. Queréis minimizar la utilización de recursos en vuestro sistema de producción que necesita análisis. Entonces, ¿qué tal si hacéis un pequeño ajuste?

  1. Definir un archivo INC con estos macros:
#define START(%level) try { ##continue 
s zzroutine=$p($view(-1,-3),"^",6) ##continue 
if ##class(%Monitor.System.LineByLine).IsActive(zzroutine)=0 { ##continue $$$ThrowOnError(##class(%Monitor.System.LineByLine).Start($lfs(zzroutine),$lfs(##class(%Monitor.System.LineByLine).GetMetrics(%level)),$lb($job))) ##continue } ##continue 
h 1 ##continue 
} catch (e) { ##continue
 d BACK^%ETN ##continue 
} 

#define PAUSE s sc=##class(%Monitor.System.LineByLine).Pause()

2. En vuestra clase o rutina, identificad el lugar que queréis monitorizar y poned estos dos macros para empezar a recopilar datos y pausar la recopilación, como en este ejemplo:

$$$START(2)   // use 1 or 2 here

// code of your application here

$$$PAUSE

Cada vez que ejecutéis este código (método de una clase o rutina), intentará iniciar %SYS.MONLBL para esta clase o rutina y proceso en particular.

Una vez que vuestro código haya terminado, simplemente podéis ir al terminal en el namespace donde se ejecuta vuestra aplicación y llamar a d ^%SYS.MONLBL. Como el macro START inició el monitor, seguirá funcionando y podréis recopilar fácilmente los datos de rendimiento, opcionalmente junto con el código fuente. ¡No olvidéis detener el monitor una vez hayáis recogido los datos!

Si necesitáis recopilar datos para más rutinas, podéis modificar fácilmente el macro START para permitir la entrada manual de la lista de rutinas a analizar.

¡Espero que encontréis útil este pequeño ajuste!

Comentarios (0)1
Inicie sesión o regístrese para continuar
Resumen
· 19 mayo, 2025
Pregunta
· 18 mayo, 2025

REST API Issue

I have a rest API Class used for getting data from Cache 2018 version.
I have single route '/callfuntions'
I send the following parameters to the API :-  className, methodName, params
I use $CLASSMETHOD to execute and send the result back to the client.

If I make more that 10 to 12 requests in quick succession, then it stops sending data.

if I wait for over 10 seconds it allows me to send more requests to the API.  How do I resolve this?

3 comentarios
Comentarios (3)2
Inicie sesión o regístrese para continuar