<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Perf &amp; Metrics on Medium]]></title>
        <description><![CDATA[Stories by Perf &amp; Metrics on Medium]]></description>
        <link>https://medium.com/@perf-and-metrics?source=rss-a21d3ded97d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IKStYsXrgf6FQsboyLkR-g.jpeg</url>
            <title>Stories by Perf &amp;amp; Metrics on Medium</title>
            <link>https://medium.com/@perf-and-metrics?source=rss-a21d3ded97d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 01:33:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@perf-and-metrics/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Log Day 0: QuickPizza]]></title>
            <link>https://perf-and-metrics.medium.com/log-day-0-quickpizza-d856356af5a3?source=rss-a21d3ded97d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d856356af5a3</guid>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[k6]]></category>
            <dc:creator><![CDATA[Perf & Metrics]]></dc:creator>
            <pubDate>Tue, 15 Oct 2024 02:57:11 GMT</pubDate>
            <atom:updated>2024-10-15T02:57:11.405Z</atom:updated>
            <content:encoded><![CDATA[<h3>Log Day 0: QuickPizza — The Beginning and the Challenges I Didn’t See Coming</h3><h3>The Dream That Came to Life</h3><p>Today is the day I’ve been waiting for months. <strong>QuickPizza</strong>, my dream come true, is finally online. Imagine this: an attractive website with pictures of pizzas so mouthwatering you can almost smell the melted cheese and fresh tomato sauce. The menu is diverse, the ordering process is simple, and everything works perfectly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CLSB_6e-aBHo-FNG" /></figure><p>I ran all the necessary functional tests; every button, every link, every form. I had heard stories from other entrepreneurs who faced issues by not preparing for real traffic, but I thought, “That won’t happen to me. My business is small, and I need to save money right now.” I decided not to invest in additional performance testing or more robust infrastructure. What could go wrong?</p><h3>The Impact of Reality: I Wasn’t Prepared for Real Traffic</h3><p>The first few hours were exciting. Orders started coming in, and my team and I were euphoric. But then, the dinner rush hit. Suddenly, the site began to slow down. Pages took forever to load, and some customers couldn’t complete their orders. Worst of all: the site went down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*fWzMGKuG4DCKqEXJ" /></figure><p>I felt a knot in my stomach. Calls and messages from frustrated customers came flooding in. I realized I wasn’t prepared for real traffic. I had underestimated the demand and overestimated my website’s capacity. My dream was turning into a public nightmare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*JQMEOLv0T9J-iHlH" /></figure><h3>Beyond Traffic: It’s Not Just About Users, but Knowing What’s Failing</h3><p>Desperate to fix the problem, I increased server resources, thinking that would solve everything. However, the issues persisted. The site was still slow, and some customers still couldn’t complete their orders. I realized it wasn’t just about handling more users but understanding <strong>what was failing in the system</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*S0iiUPTB-NykWn4A" /></figure><p>I needed visibility or some way to observe what was happening behind the scenes, but I didn’t have the tools to gather that information. Without knowing where the problem was, it was impossible to fix it effectively.</p><h3>The Limitations of Basic Metrics: Sometimes, Metrics Alone Aren’t Enough</h3><p>I implemented some basic metrics to monitor server performance: CPU usage, memory, network traffic. However, while these metrics gave me a general idea, they didn’t help me pinpoint the specific problems my customers were facing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ButrDpG6tadCBTBn" /></figure><p>There were times when a customer called saying they couldn’t complete their order, but the metrics showed nothing out of the ordinary. I felt like I was searching for a needle in a haystack. I realized that sometimes, metrics alone aren’t enough, and I needed to improve how I observed what was happening.</p><h3>The Final Clue: Sometimes, Logs Are All You Have</h3><p>I thought maybe the server logs could give me some clues. However, sifting through tons of log files without the right tool was like trying to find a grain of sand on a beach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*mHq6G1gS3JVjloHo" /></figure><p>I needed an efficient way to manage and analyze logs to find the root cause of the issues. Sometimes, logs are all you have to understand what’s really going on.</p><h3>The User Experience Puzzle: The End-User Experience Remained a Mystery</h3><p>After realizing that I didn’t really know how my system was working, I wondered, “How does this look for my customers?” I had no idea what the experience was like from the user’s browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ot_0rsRBWM9nJb6A" /></figure><p>Did the site look good on all devices? Were there JavaScript errors affecting functionality? The end-user experience remained a mystery to me. I realized that without understanding how my customers interacted with the site, I couldn’t guarantee a satisfying experience.</p><h3>A New Beginning: Learning from Mistakes</h3><p>This series of events made me see that I needed to change my approach. I couldn’t continue operating blindly, hoping things would work by magic. I decided it was time to learn and apply the right tools and practices to ensure QuickPizza’s success.</p><h3>Next Steps: The Tools I Will Implement on This Journey</h3><h4><strong>Load Testing with </strong><a href="https://k6.io/"><strong>Grafana k6</strong></a></h4><p><strong>Why</strong>: I need to properly prepare for real traffic and understand how my site handles user concurrency.<br><strong>How it helps</strong>: By simulating multiple users accessing the site simultaneously, I can identify bottlenecks and optimize performance before real users are affected.</p><h4><strong>Monitoring Metrics with </strong><a href="https://prometheus.io/"><strong>Prometheus</strong></a><strong>, </strong><a href="https://grafana.com/oss/mimir/"><strong>Mimir</strong></a><strong>, and </strong><a href="https://grafana.com/grafana/"><strong>Grafana</strong></a></h4><p><strong>Why</strong>: Basic metrics aren’t enough. I need detailed visibility into system performance.<br><strong>How it helps</strong>: I will be able to monitor my infrastructure in real-time, visualize historical data, and set alerts to proactively detect issues.</p><h4><strong>Log Management with </strong><a href="https://grafana.com/oss/loki/"><strong>Grafana Loki</strong></a></h4><p><strong>Why</strong>: Sometimes, logs are the only source of information to diagnose complex problems.<br><strong>How it helps</strong>: With an efficient log management tool, I can quickly search and analyze error messages, finding patterns and root causes.</p><h4><strong>Distributed Tracing with </strong><a href="https://grafana.com/oss/tempo/"><strong>Grafana Tempo</strong></a></h4><p><strong>Why</strong>: I need to understand the flow of requests and find exactly where failures occur.<br><strong>How it helps</strong>: Traces will allow me to follow each request’s journey through the different components of my application, identifying specific points of failure.</p><h4><strong>End-User Experience Monitoring with </strong><a href="https://grafana.com/oss/faro/"><strong>Grafana Faro</strong></a></h4><p><strong>Why</strong>: Customer satisfaction is key, and I need to ensure the user experience is optimal.<br><strong>How it helps</strong>: Faro will let me see performance and errors from the user’s perspective, identifying frontend issues that could be affecting their experience.</p><h3>An Invitation to Learn Together</h3><p>If you’ve gone through or are currently facing a similar situation, I invite you to join me on this journey of learning and continuous improvement. In upcoming articles, I’ll share in detail how I implemented each of these tools and how they helped me overcome the challenges I faced.</p><p><strong>Article 1</strong>: Preparing for Real Traffic with Grafana k6 — Learning About Performance Testing<br><strong>Article 2</strong>: Beyond Basic Metrics: Monitoring with Prometheus and Grafana — Understanding Observability<br><strong>Article 3</strong>: When Logs Are All You Have: Managing with Loki<br><strong>Article 4</strong>: Uncovering Failures with Distributed Tracing and Tempo<br><strong>Article 5</strong>: Unraveling the Mystery of User Experience with Faro</p><h3><strong>Conclusion</strong>: Turning Challenges into Opportunities</h3><p>Though the beginning was rocky, I’m determined to turn these challenges into opportunities to strengthen QuickPizza. I’ve learned that it’s not just about having a functional website but about deeply understanding how it operates and how my customers experience it.</p><p>This is the start of a new phase, not only for my business but also for my growth as an entrepreneur. I’m excited about what’s to come and to share this journey with you.</p><p><strong>Final Message</strong><br>Don’t let obstacles stop you. Every challenge is an opportunity to learn and improve. If you’re launching an online project or want to enhance your website’s performance and user experience, I encourage you to follow this series. Feel free to contact me via my <a href="https://chat.whatsapp.com/LcKpmMewq7a6v89jPqaUcZ">WhatsApp</a> community or <a href="https://www.linkedin.com/in/jwcastillo/">LinkedIn</a>. Together, we can build digital experiences that truly make a difference.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d856356af5a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Artículo 1: Preparándome para el Tráfico Real con Grafana k6]]></title>
            <link>https://perf-and-metrics.medium.com/art%C3%ADculo-1-prepar%C3%A1ndome-para-el-tr%C3%A1fico-real-con-grafana-k6-aprendiendo-sobre-performance-ed7ca6c4883d?source=rss-a21d3ded97d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed7ca6c4883d</guid>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[k6]]></category>
            <category><![CDATA[ecommerce]]></category>
            <dc:creator><![CDATA[Perf & Metrics]]></dc:creator>
            <pubDate>Tue, 15 Oct 2024 02:05:28 GMT</pubDate>
            <atom:updated>2024-10-15T02:49:09.095Z</atom:updated>
            <content:encoded><![CDATA[<h3>Artículo 1: Preparándome para el Tráfico Real con Grafana k6 — Aprendiendo sobre Performance Testing</h3><h3>Introducción</h3><p>Después del colapso inesperado de <strong>QuickPizza</strong> durante nuestra hora punta, me encontré sentado en mi oficina, rodeado de cajas de pizza frías y pilas de notas garabateadas. La emoción del lanzamiento había sido reemplazada por frustración y ansiedad. ¿Cómo podía haber fallado en prever este desastre?</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*fWzMGKuG4DCKqEXJ" /></figure><p>Recordé las llamadas de los clientes molestos, las quejas en las redes sociales y, sobre todo, la sensación de impotencia al ver cómo mi sueño se desmoronaba. Sabía que necesitaba una solución, y rápido. Fue entonces cuando decidí sumergirme en el mundo del <strong>performance testing</strong>.</p><p>Este es el relato de cómo, paso a paso, descubrí las herramientas y técnicas que me permitieron transformar la pesadilla en una oportunidad para aprender y crecer.</p><h3>El Problema: No Estaba Preparado para el Tráfico Real</h3><p>Esa noche fatídica, mientras veía cómo el sitio web de <strong>QuickPizza</strong> se volvía cada vez más lento hasta finalmente colapsar, me di cuenta de que había subestimado la importancia de prepararme para el tráfico real. Las pruebas funcionales habían sido exitosas, pero nunca había puesto a prueba el sitio bajo las condiciones de estrés que experimentaríamos durante la hora punta.</p><p>Las consecuencias fueron devastadoras:</p><ul><li><strong>Pérdida de ventas</strong>: Los clientes no podían completar sus pedidos.</li><li><strong>Daño a la reputación</strong>: Comentarios negativos se propagaron rápidamente en línea.</li><li><strong>Desconfianza del cliente</strong>: Algunos prometieron no volver a usar nuestro servicio.</li></ul><p>Me sentía abrumado, pero sabía que quedarme lamentando no resolvería nada. Tenía que encontrar una solución y asegurarme de que esto no volviera a suceder.</p><h3>Un Nuevo Comienzo: Aprendiendo sobre Performance Testing</h3><p>Comencé investigando por qué mi sitio había fallado y descubrí que las pruebas funcionales no eran suficientes. Necesitaba entender cómo se comportaba el sistema bajo carga, es decir, cuán bien funcionaba cuando muchos usuarios lo utilizaban al mismo tiempo.</p><h3>¿Qué es el Performance Testing?</h3><p>El <strong>performance testing</strong> se enfoca en evaluar cómo funciona un sistema bajo ciertas condiciones de carga. No se trata solo de si el sistema funciona, sino de cómo responde en términos de velocidad, estabilidad y escalabilidad cuando está bajo presión.</p><p>Comprendí que, al realizar pruebas de rendimiento, podía:</p><ul><li><strong>Mejorar la experiencia del usuario</strong>: Identificar y solucionar problemas antes de que afecten a los clientes.</li><li><strong>Prepararme para demandas inesperadas</strong>: Saber hasta dónde podía llegar el sistema antes de fallar.</li><li><strong>Aumentar la confianza en la aplicación</strong>: Reducir riesgos y fortalecer la confianza en el negocio.</li><li><strong>Optimizar la infraestructura</strong>: Utilizar los recursos de manera eficiente, ahorrando costos.</li></ul><h3>Desmitificando Obstáculos</h3><p>Al principio, pensé que las pruebas de rendimiento serían costosas, consumirían mucho tiempo y requerirían conocimientos técnicos avanzados. Sin embargo, descubrí que:</p><ul><li><strong>Cualquier negocio puede beneficiarse</strong>, sin importar su tamaño.</li><li><strong>Las herramientas modernas facilitan el proceso</strong> y no necesariamente requieren una gran inversión.</li><li><strong>Es posible comenzar con pruebas sencillas</strong> y escalar según las necesidades.</li></ul><h3>Diferentes Tipos de Pruebas de Carga</h3><p>Aprendí que existen varios escenarios de pruebas de carga, cada uno con un propósito específico:</p><ol><li><strong>Prueba de Sacudida (Shakeout Test)</strong>: Una prueba inicial de baja carga para identificar problemas críticos.</li><li><strong>Prueba de Carga Promedio (Average Load Test)</strong>: Simula la carga típica esperada en producción.</li><li><strong>Prueba de Estrés (Stress Test)</strong>: Simula pico de carga para evaluar el rendimiento bajo demanda máxima.</li><li><strong>Prueba de Resistencia (Soak Test)</strong>: Ejecuta cargas durante períodos prolongados para identificar problemas como fugas de memoria.</li><li><strong>Prueba de Pico (Spike Test)</strong>: Introduce cargas repentinas para evaluar la capacidad del sistema de manejar incrementos bruscos de tráfico.</li><li><strong>Prueba de Punto de Quiebre (Breakpoint Test)</strong>: Aumenta la carga hasta que el sistema falla para identificar su límite máximo.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*ECfFfsiBc5eDeohle8qADw.png" /><figcaption>Common load test</figcaption></figure><p>Para más detalles sobre estos tipos de pruebas, consulté la <a href="https://grafana.com/docs/k6/latest/">documentación oficial de k6.</a></p><h3>Descubriendo Grafana k6: Mi Aliado en las Pruebas de Carga</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*AmeecxhMma3Zjq7gY9uAiA.jpeg" /></figure><p>En mi búsqueda, me topé con <a href="https://k6.io/"><strong>k6</strong></a>, una herramienta de código abierto para realizar pruebas de carga y rendimiento. Lo que me atrajo de k6 fue su simplicidad y flexibilidad. Podía escribir scripts en JavaScript, un lenguaje con el que ya estaba familiarizado.</p><p><strong>Ventajas de k6</strong>:</p><ul><li><strong>Fácil de usar</strong>: No requería aprender un nuevo lenguaje.</li><li><strong>Eficiente</strong>: Podía simular miles de usuarios con pocos recursos.</li><li><strong>Integrable</strong>: Compatible con otras herramientas y flujos de trabajo.</li></ul><h3>Implementación de k6: Paso a Paso en Mi Camino hacia la Recuperación</h3><p>Decidido a tomar acción, me propuse aprender a utilizar k6 y aplicarlo a <strong>QuickPizza</strong>. Aquí comparto el proceso que seguí, con la esperanza de que pueda ser útil para otros en situaciones similares.</p><h3>Paso 1: Instalación de k6 en Mac</h3><p>Como uso una Mac, los pasos de instalación fueron sencillos gracias a Homebrew. Si aún no tienes Homebrew instalado, puedes seguir las instrucciones en su sitio <a href="https://grafana.com/docs/k6/latest/set-up/install-k6/">oficial</a>.</p><p><strong>Instalación de k6</strong>:</p><pre>brew install k6</pre><h3>Paso 2: Configuración Inicial y Variables de Entorno</h3><p>Empecé importando los módulos necesarios:</p><pre>import http from &quot;k6/http&quot;;<br>import { check, sleep } from &quot;k6&quot;;</pre><p>Definí la URL base de mi sitio, permitiendo cambiar fácilmente entre entornos:</p><pre>const BASE_URL = __ENV.BASE_URL || &#39;http://localhost:3333&#39;;</pre><p>Esto me permite ejecutar pruebas en diferentes entornos sin modificar el código.</p><h3>Paso 3: Definición de Opciones y Escenarios de Carga</h3><p>Configuré las opciones para simular un escenario de carga realista:</p><pre>export const options = {<br>  stages: [<br>    { duration: &#39;2m&#39;, target: 50 }, // Ramp-up de 0 a 50 usuarios en 2 minutos<br>    { duration: &#39;5m&#39;, target: 50 }, // Mantiene 50 usuarios por 5 minutos<br>    { duration: &#39;2m&#39;, target: 0 },  // Ramp-down de 50 a 0 usuarios en 2 minutos<br>  ],<br>  thresholds: {<br>    http_req_failed: [&#39;rate&lt;0.01&#39;],        // Menos del 1% de las solicitudes deben fallar<br>    http_req_duration: [&#39;p(95)&lt;500&#39;],      // El 95% de las solicitudes deben ser menores a 500ms<br>    checks: [&#39;rate&gt;0.99&#39;],                 // Al menos el 99% de los checks deben pasar<br>  },<br>};</pre><p>Este escenario es una <strong>Prueba de Carga Promedio</strong>, simulando la carga típica esperada.</p><h3>Paso 4: Creación de Métricas Personalizadas</h3><p>Quería medir aspectos específicos, así que creé métricas personalizadas:</p><pre>import { Trend, Counter } from &quot;k6/metrics&quot;;<br><br>const pizzas = new Counter(&#39;quickpizza_number_of_pizzas&#39;);<br>const ingredients = new Trend(&#39;quickpizza_ingredients&#39;);</pre><p>Estas métricas me permitirían rastrear el número de pizzas solicitadas y el promedio de ingredientes por pizza.</p><h3>Paso 5: Asegurando que Todo Esté Listo con la Función setup</h3><p>Antes de iniciar las pruebas, necesitaba confirmar que el sitio estuviera operativo:</p><pre>export function setup() {<br>  let res = http.get(BASE_URL);<br>  if (res.status !== 200) {<br>    throw new Error(`Error ${res.status} al intentar acceder al sitio.`);<br>  }<br>}</pre><p>Esto me daba tranquilidad de que estaba probando sobre una base sólida.</p><h3>Paso 6: Simulando el Comportamiento del Usuario en la Función default</h3><p>Aquí es donde definí las acciones que realizarían los usuarios:</p><pre>export default function () {<br>  let restrictions = {<br>    maxCaloriesPerSlice: 500,<br>    mustBeVegetarian: false,<br>    excludedIngredients: [&quot;pepperoni&quot;],<br>    excludedTools: [&quot;knife&quot;],<br>    maxNumberOfToppings: 6,<br>    minNumberOfToppings: 2<br>  };<br>  let res = http.post(`${BASE_URL}/api/pizza`, JSON.stringify(restrictions), {<br>    headers: {<br>      &#39;Content-Type&#39;: &#39;application/json&#39;,<br>      &#39;X-User-ID&#39;: Math.floor(Math.random() * 10000),<br>    },<br>  });<br>  check(res, { &quot;status is 200&quot;: (res) =&gt; res.status === 200 });<br>  console.log(`${res.json().pizza.name} (${res.json().pizza.ingredients.length} ingredientes)`);<br>  pizzas.add(1);<br>  ingredients.add(res.json().pizza.ingredients.length);<br>  sleep(1);<br>}</pre><ul><li><strong>Definí restricciones</strong>: Simulando las preferencias del cliente.</li><li><strong>Realicé una solicitud POST</strong>: Para pedir una pizza personalizada.</li><li><strong>Verifiqué la respuesta</strong>: Asegurando que el servidor respondiera correctamente.</li><li><strong>Registré información y actualicé métricas</strong>: Para analizar después.</li><li><strong>Incluí un </strong><strong>sleep</strong>: Simulando el tiempo de espera entre acciones.</li></ul><p>Para más detalles sobre cómo escribir scripts en k6, puedes consultar la guía de <a href="https://grafana.com/docs/k6/latest/using-k6/">uso de k6.</a></p><h3>Paso 7: Preparando el Cierre con la Función teardown</h3><p>Aunque opcional, quise añadir un cierre a mi script:javascriptCopiar códig</p><pre>export function teardown() {<br>  console.log(&quot;¡Pruebas completadas!&quot;);<br>}</pre><p>Esto me permitiría, en el futuro, añadir acciones como notificaciones al equipo.</p><h3>Paso 8: Ejecutando la Prueba y Analizando los Resultados</h3><p>Con el script listo, procedí a ejecutarl</p><pre>k6 run script.js</pre><p>Los resultados fueron reveladores:</p><pre>checks.....................: 99.85% ✓ 498 ✗ 2<br>http_req_duration..........: avg=350ms min=100ms med=300ms max=900ms p(95)=480ms<br>http_req_failed............: 0.15%  ✓ 2   ✗ 498<br>quickpizza_number_of_pizzas: 500<br>quickpizza_ingredients.....: avg=5.5  min=3   med=5   max=8    p(95)=7</pre><ul><li><strong>Alto porcentaje de éxito</strong>: La mayoría de los checks pasaron.</li><li><strong>Tiempos de respuesta aceptables</strong>: Dentro de los umbrales establecidos.</li><li><strong>Número de pizzas solicitadas</strong>: 500 durante la prueba.</li></ul><p>Me emocioné al ver que el sitio podía manejar este nivel básico de carga. Sin embargo, sabía que debía probar con cargas mayores.</p><h4>Enlaces a Conceptos Clave</h4><ul><li><strong>Configuración de opciones</strong>: k6 <a href="https://grafana.com/docs/k6/latest/using-k6/k6-options/">Options</a></li><li><strong>Escenarios y etapas</strong>: <a href="https://grafana.com/docs/k6/latest/using-k6/scenarios/">Configuración de escenarios</a></li><li><strong>Métricas personalizadas</strong>: k6 <a href="https://grafana.com/docs/k6/latest/using-k6/metrics/">Metrics</a></li><li><strong>Funciones </strong><strong>setup y </strong><strong>teardown</strong>: <a href="https://grafana.com/docs/k6/latest/using-k6/test-lifecycle/">Lifecycle</a></li><li><strong>Checks y Thresholds</strong>: <a href="https://grafana.com/docs/k6/latest/using-k6/checks/">Checks</a>, <a href="https://grafana.com/docs/k6/latest/using-k6/thresholds/">Thresholds</a></li></ul><h3>Descubriendo los Cuellos de Botella: El Camino Hacia la Optimización</h3><p>Incrementé gradualmente la carga, realizando diferentes tipos de pruebas:</p><h3>Prueba de Estrés</h3><p>Quise ver cómo el sistema manejaba cargas máximas:</p><pre>export const options = {<br>  stages: [<br>    { duration: &#39;5m&#39;, target: 200 }, // Ramp-up a 200 usuarios en 5 minutos<br>    { duration: &#39;10m&#39;, target: 200 }, // Mantiene 200 usuarios por 10 minutos<br>    { duration: &#39;5m&#39;, target: 0 },    // Ramp-down a 0 usuarios en 5 minutos<br>  ],<br>  thresholds: {<br>    http_req_failed: [&#39;rate&lt;0.02&#39;],<br>    http_req_duration: [&#39;p(95)&lt;800&#39;],<br>  },<br>};</pre><h3>Prueba de Pico (Spike Test)</h3><p>Simulé un aumento repentino de usuarios:</p><pre>export const options = {<br>  stages: [<br>    { duration: &#39;10s&#39;, target: 0 },<br>    { duration: &#39;10s&#39;, target: 300 }, // Súbito incremento a 300 usuarios<br>    { duration: &#39;30s&#39;, target: 300 },<br>    { duration: &#39;10s&#39;, target: 0 },   // Descenso rápido a 0<br>  ],<br>};</pre><h3>Prueba de Resistencia (Soak Test)</h3><p>Evalué el rendimiento a largo plazo:</p><pre>export const options = {<br>  stages: [<br>    { duration: &#39;2h&#39;, target: 50 }, // Mantiene 50 usuarios por 2 horas<br>  ],<br>  thresholds: {<br>    http_req_failed: [&#39;rate&lt;0.01&#39;],<br>    http_req_duration: [&#39;p(95)&lt;500&#39;],<br>  },<br>};</pre><p>Al ejecutar estas pruebas, identifiqué problemas:</p><ul><li><strong>Tiempos de respuesta elevados</strong>: Superaban los umbrales con cargas altas.</li><li><strong>Errores intermitentes</strong>: Especialmente durante los picos de carga.</li><li><strong>Fugas de memoria</strong>: Detectadas en la prueba de resistencia.</li></ul><h3>Tomando Acción: Mejoras Implementadas</h3><ul><li><strong>Optimización de la base de datos</strong>: Mejoré consultas y agregué índices.</li><li><strong>Escalabilidad</strong>: Implementé balanceadores de carga y servidores adicionales.</li><li><strong>Gestión de recursos</strong>: Ajusté parámetros de configuración del servidor.</li><li><strong>Monitoreo continuo</strong>: Implementé herramientas como <strong>Prometheus, Mimir </strong>y <strong>Grafana</strong> (que abordaré en el próximo artículo).</li></ul><h3>Validando las Mejoras con Nuevas Pruebas</h3><p>Volví a ejecutar las pruebas después de las mejoras. Los resultados fueron alentadores:</p><ul><li><strong>Tiempos de respuesta reducidos</strong>: Cumplían con los umbrales establecidos.</li><li><strong>Estabilidad bajo carga</strong>: El sistema manejó picos sin problemas.</li><li><strong>Sin fugas de memoria</strong>: Confirmado en la prueba de resistencia.</li></ul><p>Sentí una gran satisfacción al ver cómo los esfuerzos daban frutos. <strong>QuickPizza</strong> estaba listo para enfrentar el tráfico real.</p><h3>Reflexiones Finales: Lecciones Aprendidas en el Camino</h3><p>Este viaje me enseñó valiosas lecciones que quisiera compartir:</p><ul><li><strong>La importancia del performance testing</strong>: No es un lujo, sino una necesidad para cualquier negocio en línea.</li><li><strong>Comenzar pequeño y escalar</strong>: Es posible iniciar con pruebas sencillas y aumentar la complejidad según se requiera.</li><li><strong>Herramientas adecuadas hacen la diferencia</strong>: k6 fue esencial en este proceso, demostrando ser una herramienta poderosa y accesible.</li><li><strong>La preparación es clave</strong>: Anticiparse a los problemas permite ofrecer una mejor experiencia al cliente y proteger la reputación de la marca.</li></ul><h3>Una Invitación a Otros Emprendedores</h3><p>Si estás iniciando o ya tienes un negocio en línea, te animo a que no subestimes la importancia de las pruebas de rendimiento. No esperes a que ocurra un desastre para tomar acción.</p><p>Comienza hoy mismo:</p><ul><li><strong>Explora herramientas como k6</strong>: Experimenta y aprende.</li><li><strong>Involucra a tu equipo</strong>: Comparte conocimientos y trabaja en conjunto.</li><li><strong>Establece objetivos claros</strong>: Define umbrales y métricas que sean importantes para tu negocio.</li></ul><p><strong>Estoy aquí para apoyarte en tu camino hacia el éxito</strong>. Si tienes preguntas, necesitas orientación o estás interesado en servicios de consultoría para optimizar el rendimiento de tu aplicación, no dudes en contactarme a través de mi comunidad en <a href="https://chat.whatsapp.com/IoCkBMx9JRn4D2zJ5MXxSv">WhatsApp</a> o en <a href="https://www.linkedin.com/in/jwcastillo/">LinkedIn</a>. Juntos, podemos fortalecer tu proyecto y asegurar su éxito a largo plazo</p><p><strong>¡Gracias por acompañarme en este viaje de aprendizaje y superación!</strong> En el próximo artículo, compartiré cómo implementé un monitoreo avanzado con <strong>Prometheus</strong> y <strong>Grafana</strong>, y cómo estas herramientas me ayudaron a tener una visión más clara y profunda del rendimiento de <strong>QuickPizza</strong>. ¡Te espero!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed7ca6c4883d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitácora Día 0: QuickPizza]]></title>
            <link>https://perf-and-metrics.medium.com/bit%C3%A1cora-d%C3%ADa-0-quickpizza-el-inicio-y-los-retos-que-no-vi-venir-4cbc870c2098?source=rss-a21d3ded97d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cbc870c2098</guid>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[k6]]></category>
            <category><![CDATA[grafana]]></category>
            <dc:creator><![CDATA[Perf & Metrics]]></dc:creator>
            <pubDate>Tue, 15 Oct 2024 01:09:27 GMT</pubDate>
            <atom:updated>2024-10-15T02:54:03.728Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bitácora Día 0: QuickPizza — El Inicio y los Retos que No Vi Venir</h3><h3>El Sueño que Cobró Vida</h3><p>Hoy es el día que he estado esperando durante meses. <strong>QuickPizza</strong>, mi sueño hecho realidad, finalmente está en línea. Imagina esto: un sitio web atractivo, con imágenes de pizzas tan deliciosas que casi puedes oler el queso derretido y la salsa de tomate fresca. El menú es variado, el proceso de pedido es sencillo y todo parece funcionar a la perfección.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o4HmnafflMzHt8rh" /><figcaption>QuickPizza Site</figcaption></figure><p>Realicé todas las pruebas funcionales necesarias; cada botón, cada enlace, cada formulario. Había escuchado historias de otros emprendedores que enfrentaron problemas al no prepararse para el tráfico real, pero pensé: “Eso no me pasará a mí. Mi negocio es pequeño y necesito ahorrar dinero ahora”. Decidí no invertir en pruebas de rendimiento adicionales ni en infraestructura más robusta. ¿Qué podría salir mal?</p><h3>El Impacto de la Realidad: No Estaba Preparado para el Tráfico Real</h3><p>Las primeras horas fueron emocionantes. Los pedidos empezaron a llegar y mi equipo y yo estábamos eufóricos. Pero entonces llegó la hora punta de la cena. De repente, el sitio comenzó a ralentizarse. Las páginas tardaban una eternidad en cargar, y algunos clientes no podían completar sus pedidos. Y lo peor de todo: el sitio se cayó.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rWenTKFXYYUgLJTy" /></figure><p>Sentí un nudo en el estómago. Las llamadas y mensajes de clientes frustrados no se hicieron esperar. Me di cuenta de que no estaba preparado para el tráfico real. Había subestimado la demanda y sobreestimado la capacidad de mi sitio web. Mi sueño se estaba convirtiendo en una pesadilla pública.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2YKllN_UgXaWiY54" /></figure><h3>Más Allá del Tráfico: No Solo es Cuestión de Usuarios, Sino de Saber Qué Falla</h3><p>Desesperado por solucionar el problema, aumenté los recursos del servidor pensando que eso resolvería todo. Sin embargo, los problemas persistían. El sitio seguía siendo lento, y algunos clientes aún no podían completar sus pedidos. Me di cuenta de que no solo se trataba de soportar más usuarios, sino de entender <strong>qué</strong> estaba fallando exactamente en el sistema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z59e1w3CS317oTiz" /></figure><p>Necesitaba visibilidad o alguna forma de observar lo que ocurría detrás de escena, pero no tenía las herramientas para obtener esa información. Sin saber dónde estaba el problema, era imposible solucionarlo de manera efectiva.</p><h3>Las Limitaciones de las Métricas Básicas: A Veces, Solo con Métricas No es Suficiente</h3><p>Implementé algunas métricas básicas para monitorear el rendimiento del servidor: uso de CPU, memoria, tráfico de red. Sin embargo, aunque estas métricas me daban una idea general, no me ayudaban a identificar los problemas específicos que mis clientes estaban experimentando.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YbKfT_NiPbEHnwSJ" /></figure><p>Hubo veces en las que un cliente me llamaba diciendo que no podía completar su pedido, pero las métricas no mostraban nada fuera de lo común. Sentía que estaba buscando una aguja en un pajar. Me di cuenta de que, a veces, solo con métricas no es suficiente, entendí que necesitaba mejorar la forma de observar de lo que ocurre.</p><h3>La Última Pista: A Veces, Los Logs son Todo lo que Tienes</h3><p>Pensé que quizás los logs del servidor podrían darme alguna pista. Sin embargo, navegar entre montones de archivos de logs sin una herramienta adecuada era como intentar encontrar un grano de arena en la playa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*laceer4aRnn7jKdY" /></figure><p>Necesitaba una forma eficiente de gestionar y analizar los logs para poder encontrar la causa raíz de los problemas. A veces, los logs son todo lo que tienes para entender qué está pasando realmente.</p><h3>El Enigma de la Experiencia del Usuario: La Experiencia del Usuario Final Sigue Siendo un Misterio</h3><p>Después de entender que no sabía realmente lo que hace mi sistema, me pregunté: “¿Cómo se ve esto para mis clientes?”, no tenía idea de cómo era la experiencia desde el navegador de los usuarios.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*krM4m6mnD6yM1ety" /></figure><p>¿El sitio se veía bien en todos los dispositivos? ¿Había errores de JavaScript que pudieran estar afectando la funcionalidad? La experiencia del usuario final seguía siendo un misterio para mí. Me di cuenta de que, sin entender cómo mis clientes interactuaban con el sitio, no podía garantizar una experiencia satisfactoria.</p><h3>Un Nuevo Comienzo: Aprendiendo de los Errores</h3><p>Esta serie de eventos me hizo ver que necesitaba cambiar mi enfoque. No podía seguir operando a ciegas, esperando que las cosas funcionaran por arte de magia. Decidí que era hora de aprender y aplicar las herramientas y prácticas adecuadas para asegurar el éxito de QuickPizza.</p><h3>Próximos Pasos: Las Herramientas que Implementaré en Este Viaje</h3><h4><strong>Pruebas de Carga con </strong><a href="https://k6.io/"><strong>Grafana k6</strong></a></h4><p><strong>Por qué:</strong> Necesito prepararme adecuadamente para el tráfico real y entender cómo mi sitio maneja la concurrencia de usuarios.</p><p><strong>Cómo ayudará:</strong> Simulando múltiples usuarios accediendo al sitio al mismo tiempo, podré identificar cuellos de botella y optimizar el rendimiento antes de que los usuarios reales se vean afectados.</p><h4><strong>Monitoreo de Métricas con </strong><a href="https://prometheus.io/"><strong>Prometheus</strong></a>, <a href="https://grafana.com/oss/mimir/">Mimir</a> <strong>y </strong><a href="https://grafana.com/grafana/"><strong>Grafana</strong></a></h4><p><strong>Por qué:</strong> Las métricas básicas no son suficientes. Necesito una visibilidad detallada del rendimiento del sistema.</p><p><strong>Cómo ayudará:</strong> Podré monitorear en tiempo real el estado de mi infraestructura, visualizar datos históricos y establecer alertas para detectar problemas proactivamente.</p><h4>Gestión de Logs con <a href="https://grafana.com/oss/loki/">Grafana Loki</a></h4><p><strong>Por qué:</strong> A veces, los logs son la única fuente de información para diagnosticar problemas complejos.</p><p><strong>Cómo ayudará:</strong> Con una herramienta eficiente de gestión de logs, podré buscar y analizar mensajes de error de manera rápida, encontrando patrones y causas raíz.</p><h4><strong>Trazas Distribuidas con </strong><a href="https://grafana.com/oss/tempo/">Grafana <strong>Tempo</strong></a></h4><p><strong>Por qué:</strong> Necesito entender el flujo de las solicitudes y encontrar exactamente dónde ocurren los fallos.</p><p><strong>Cómo ayudará:</strong> Las trazas me permitirán seguir el recorrido de cada solicitud a través de los diferentes componentes de mi aplicación, identificando puntos de fallo específicos.</p><h4><strong>Monitoreo de la Experiencia del Usuario Final con </strong><a href="https://grafana.com/oss/faro/">Grafana <strong>Faro</strong></a></h4><p><strong>Por qué:</strong> La satisfacción del cliente es clave, y necesito asegurarme de que la experiencia del usuario sea óptima.</p><p><strong>Cómo ayudará:</strong> Faro me permitirá ver el rendimiento y errores desde la perspectiva del usuario, identificando problemas en el frontend que podrían estar afectando su experiencia.</p><h3>Una Invitación a Aprender Juntos</h3><p>Si has pasado o estás pasando por una situación similar, te invito a acompañarme en este viaje de aprendizaje y mejora continua. En los próximos artículos, compartiré en detalle cómo implementé cada una de estas herramientas y cómo me ayudaron a superar los desafíos que enfrenté.</p><ul><li><a href="https://perf-and-metrics.medium.com/art%C3%ADculo-1-prepar%C3%A1ndome-para-el-tr%C3%A1fico-real-con-grafana-k6-aprendiendo-sobre-performance-ed7ca6c4883d"><strong>Artículo 1:</strong> Preparándome para el Tráfico Real con Grafana k6 — Aprendiendo sobre Performance Testing</a></li><li><strong>Artículo 2:</strong> Más Allá de las Métricas Básicas: Monitoreo con Prometheus y Grafana — Conociendo la Observabilidad</li><li><strong>Artículo 3:</strong> Cuando los Logs Son Todo lo que Tienes: Gestión con Loki</li><li><strong>Artículo 4:</strong> Descubriendo Qué Falla con Trazas Distribuidas y Tempo</li><li><strong>Artículo 5:</strong> Desvelando el Misterio de la Experiencia del Usuario con Faro</li></ul><h3>Conclusión: Transformando los Retos en Oportunidades</h3><p>Aunque el inicio fue turbulento, estoy decidido a convertir estos desafíos en oportunidades para fortalecer QuickPizza. He aprendido que no se trata solo de tener un sitio web funcional, sino de entender profundamente cómo opera y cómo lo experimentan mis clientes.</p><p>Este es el comienzo de una nueva etapa, no solo para mi negocio, sino también para mi crecimiento como emprendedor. Estoy emocionado por lo que viene y por compartir este camino con ustedes.</p><p>¡Nos vemos en el próximo artículo!</p><p><strong>Mensaje Final</strong></p><p>No permitas que los obstáculos te detengan. Cada desafío es una oportunidad para aprender y mejorar. Si estás iniciando un proyecto en línea o quieres mejorar el rendimiento y la experiencia de tu sitio web, te animo a seguir esta serie, no dudes en contactarme a través de mi comunidad en <a href="https://chat.whatsapp.com/IoCkBMx9JRn4D2zJ5MXxSv">WhatsApp</a> o en <a href="https://www.linkedin.com/in/jwcastillo/">LinkedIn</a>. Juntos, podemos construir experiencias digitales que realmente marquen la diferencia.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cbc870c2098" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Instalar Tsung en Ubuntu]]></title>
            <link>https://perf-and-metrics.medium.com/instalar-tsung-en-ubuntu-7d2b266eab74?source=rss-a21d3ded97d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d2b266eab74</guid>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[tsung]]></category>
            <dc:creator><![CDATA[Perf & Metrics]]></dc:creator>
            <pubDate>Wed, 13 Jun 2018 20:07:14 GMT</pubDate>
            <atom:updated>2018-06-13T20:07:14.001Z</atom:updated>
            <content:encoded><![CDATA[<p>Tsung es una de las mejores herramientas Open Source para pruebas de carga. Está desarrollada en erlang, se puede conseguir más información en <a href="http://tsung.erlang-projects.org/">http://tsung.erlang-projects.org/</a></p><p>La instalación es bastante simple, en este manual instalaremos la versión 1.7.0, sobre ubuntu 16.04</p><ol><li><strong>Instalamos las dependencias y erlang</strong><br>sudo apt-get install build-essential debhelper \<br>erlang-nox erlang-dev \<br>python-matplotlib gnuplot \<br>libtemplate-perl \<br>gnuplot wget python-sphinx</li><li><strong>Instalamos tsung</strong><br> 2.1. wget <a href="http://tsung.erlang-projects.org/dist/tsung-1.7.0.tar.gz">http://tsung.erlang-projects.org/dist/tsung-1.7.0.tar.gz</a><br> 2.2. tar -xvzf tsung-1.7.0.tar.gz<br> 2.3. cd tsung-1.7.0<br> 2.4. ./configure<br> 2.5. make<br> 2.6. make deb<br> 2.7. cd ..<br> 2.8. sudo dpkg -i tsung_1.7.0–1_all.deb</li><li><strong>Revisamos que todo funcione</strong><br>tsung -v</li><li><strong>Listo.</strong></li><li><strong>Ahora </strong><a href="http://tsung.erlang-projects.org/user_manual/index.html">http://tsung.erlang-projects.org/user_manual/index.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d2b266eab74" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>