Saltar al contenido

Usar estadísticas a tu favor para detectar cuellos de botella en TIBCO BusinessWorks Container Edition

Generalmente, cuando estás desarrollando o ejecutando tu aplicación de contenedores, llegarás a un momento en que algo sale mal. Pero no de una manera que puedas resolver con tu sistema de registro y con pruebas.

Un momento en el que hay algún cuello de botella, algo que no está funcionando tan bien como deseas, y te gustaría echar un vistazo adentro. Y eso es lo que vamos a hacer. Vamos a mirar adentro.

Foto de Chris Liverani en Unsplash

Porque nuestra BusinessWorks Container Edition proporciona características tan buenas para hacerlo que necesitas usarlo a tu favor porque me lo vas a agradecer por el resto de tu vida. Así que no quiero pasar un minuto más en esto. Me gustaría comenzar a contarte ahora mismo.

Lo primero que necesitamos hacer es entrar en la consola OSGi desde el contenedor. Entonces, lo primero que hacemos es exponer el puerto 8090 como puedes ver en la imagen a continuación

Ahora, podemos exponer ese puerto a tu host, usando el comando port-forward

kubectl port-forward deploy/phenix-test-project-v1 8090:8090

Y luego podemos ejecutar una solicitud HTTP para ejecutar cualquier información usando comandos como este:

curl -v http://localhost:8090/bw/framework.json/osgi?command=<command>

Y vamos a ejecutar primero la activación de las estadísticas del proceso así:

curl -v http://localhost:8090/bw/framework.json/osgi?command=startpsc

Y como puedes ver, dice que las estadísticas han sido habilitadas para la aplicación echo, así que usando ese nombre de aplicación vamos a recopilar las estadísticas a nivel

curl -v http://localhost:8090/bw/framework.json/osgi?command=lpis%20echo

Y puedes ver las estadísticas a nivel de proceso donde puedes ver las siguientes métricas:

  • Metadatos del proceso (nombre, proceso padre y versión)
  • Total de instancias por estado (creado, suspendido, fallido y ejecutado)
  • Tiempo de ejecución (total, promedio, mínimo, máximo, más reciente)
  • Tiempo transcurrido (total, promedio, mínimo, máximo, más reciente)

Y podemos obtener las estadísticas a nivel de actividad:

Y con eso, puedes detectar cualquier cuello de botella que estés enfrentando en tu aplicación y también estar seguro de qué actividad o qué proceso es responsable de ello. Así que puedes resolverlo de una manera rápida.

¡Diviértete y usa las herramientas a tu disposición!

Etiquetas:

Using Statistics in your favor to detect bottlenecks in TIBCO BusinessWorks Container Edition

Usually, when you’re developing or running your container application you will get to a moment when something goes wrong. But not in a way you can solve with your logging system and with testing.

A moment when there is some bottleneck, something that is not performing as well as you want, and you’d like to take a look inside. And that’s what we’re going to do. We’re going to watch inside.

Photo by Chris Liverani on Unsplash

Because our BusinessWorks Container Edition provides so great features to do it that you need to use it into your favor because you’re going to thank me for the rest of your life. So, I don’t want to spend one more minute about this. I’d like to start telling you right now.

The first thing we need to do, we need to go inside the OSGi console from the container. So, the first thing we do is to expose the 8090 port as you can see in the picture below

Now, we can expose that port to your host, using the port-forward command

kubectl port-forward deploy/phenix-test-project-v1 8090:8090

And then we can execute an HTTP Request to execute any info using commands like this:

curl -v http://localhost:8090/bw/framework.json/osgi?command=<command>

And we’re are going to execute first the activation of the process statistics like this:

curl -v http://localhost:8090/bw/framework.json/osgi?command=startpsc

And as you can see it says that statistics has been enabled for echo application, so using that application name we’re going to gather the statistics at the level

curl -v http://localhost:8090/bw/framework.json/osgi?command=lpis%20echo

And you can see the statistics at the process level where you can see the following metrics:

  • Process metadata (name, parent process and version)
  • Total instance by status (create, suspended, failed and executed)
  • Execution time (total, average, min, max, most recent)
  • Elapsed time (total, average, min, max, most recent)

And we can get the statistics at the activity level:

And with that, you can detect any bottleneck you’re facing into your application and also be sure which activity or which process is responsible for it. So you can solve it in a quick way.

Have fun and use the tools at your disposal!