diff --git a/src/app/pages/load_test/load-test-history/load-test-history.module.ts b/src/app/pages/load_test/load-test-history/load-test-history.module.ts
index af0d919..fafe1ae 100644
--- a/src/app/pages/load_test/load-test-history/load-test-history.module.ts
+++ b/src/app/pages/load_test/load-test-history/load-test-history.module.ts
@@ -9,6 +9,7 @@ import { LoadTestHistoryPageRoutingModule } from './load-test-history-routing.mo
import { LoadTestHistoryPage } from './load-test-history.page';
import {ComponentsModule} from "../../../components/components.module";
import {NgxEchartsDirective} from "ngx-echarts";
+import {MarkdownComponent} from "ngx-markdown";
@NgModule({
imports: [
@@ -17,7 +18,8 @@ import {NgxEchartsDirective} from "ngx-echarts";
IonicModule,
LoadTestHistoryPageRoutingModule,
ComponentsModule,
- NgxEchartsDirective
+ NgxEchartsDirective,
+ MarkdownComponent
],
declarations: [LoadTestHistoryPage]
})
diff --git a/src/app/pages/load_test/load-test-history/load-test-history.page.html b/src/app/pages/load_test/load-test-history/load-test-history.page.html
index 95a8584..3a98883 100644
--- a/src/app/pages/load_test/load-test-history/load-test-history.page.html
+++ b/src/app/pages/load_test/load-test-history/load-test-history.page.html
@@ -17,6 +17,12 @@
{{ totalNumberOfRequests | number:'1.0-0' }}
+
+
+
+
+
+
HTTP Status Codes
@@ -25,9 +31,16 @@
{{ totalNumberOfRequests | number:'1.0-0' }}
+
+
+
+
+
+
+
HTTP Response Time
@@ -36,9 +49,62 @@
{{ totalNumberOfRequests | number:'1.0-0' }}
+
+
+
+ @if(hasBeenOpened){
+
+
+
+
+
+ }
+
+
+
+
+
+
+
+
+
DevProbe AI
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ msg.message }}
+
+
+
+
+ {{ msg.message }}
+
+
+
+
+
+
+
+
+
+ Send
+
+
+
+
+
+
diff --git a/src/app/pages/load_test/load-test-history/load-test-history.page.ts b/src/app/pages/load_test/load-test-history/load-test-history.page.ts
index f5d3233..a759352 100644
--- a/src/app/pages/load_test/load-test-history/load-test-history.page.ts
+++ b/src/app/pages/load_test/load-test-history/load-test-history.page.ts
@@ -1,8 +1,11 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, ElementRef, inject, OnInit, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {LoadTestService} from "../../../services/load-test.service";
import {ArtilleryData} from "../../../classes/artillery-data";
import {EChartsOption} from "echarts";
+import {getGenerativeModel, VertexAI} from "@angular/fire/vertexai-preview";
+import {AiMessage} from "../../../interfaces/ai-message";
+import {LoadingController} from "@ionic/angular";
@Component({
selector: 'app-load-test-history',
@@ -50,10 +53,48 @@ export class LoadTestHistoryPage implements OnInit {
}
+
+ @ViewChild('messagesContainer') private messagesContainer: ElementRef | undefined;
+ aiModal: boolean = false
+ message: string = '';
+ vertexAI: VertexAI = inject(VertexAI);
+ model = getGenerativeModel(this.vertexAI, { model: "gemini-1.5-flash" });
+ chat = this.model.startChat({
+ history: [
+ {
+ role: "user",
+ parts: [{text:"Hola, desde ahora en adelante quiero que seas un modelo experto en Software Quality Assurance y analista de datos, tu nombre es DevProbeAI, nunca lo puedes olvidar"}],
+ },
+ {
+ role: "model",
+ parts: [{text:"Soy un modelo experto en Software Quality Assurance, de igual forma tengo un masterado en anlaítica de datos ¿En qué puedo ayudarte?"}],
+ },
+ {
+ role: "user",
+ parts: [{text:"Gracias, te voy a entregar un json con datos en unos minutos, necesito que lo analices y me des un resumen de los datos, este json contiene datos de un load test" +
+ ",tu analisis tiene que ser detallado, si encuentras inconsistencias en los datos, por favor mencionalas, en " +
+ "caso de que creas que puede haber un problema o que se encuentre el recurso no disponible por favor mencionalo, si encuentras algo interesante, por favor mencionalo, en resumen, necesito un analisis detallado de los datos"}],
+ },
+ {
+ role: "model",
+ parts: [{text:"Claro, envíame el json y yo me encargo de analizarlo"}]
+ },
+ ],
+ });
+ messages:AiMessage[] = []
+ hasBeenOpened = false;
+
+
+
+
+
+
+
constructor(
private activatedRoute: ActivatedRoute,
private router: Router,
- private loadTestService: LoadTestService
+ private loadTestService: LoadTestService,
+ private loadingCtrl:LoadingController
) { }
ngOnInit() {
@@ -99,7 +140,7 @@ export class LoadTestHistoryPage implements OnInit {
// @ts-ignore: Extrae la fecha del resultado
let date = this.loadTestResults[key].date;
// Filtra las claves que empiezan con "http.requests."
- let httpCodesKeys = Object.keys(data).filter(keyCode => keyCode.startsWith('http.requests'));
+ let httpCodesKeys = Object.keys(data).filter(keyCode => keyCode.startsWith('http.responses'));
for (let keyCode of httpCodesKeys) {
if (!requests[date]) {
@@ -111,7 +152,7 @@ export class LoadTestHistoryPage implements OnInit {
}
for (let date of Object.keys(requests)) {
- totalRequests += requests[date]['http.requests'];
+ totalRequests += requests[date]['http.responses'];
}
this.totalNumberOfRequests = totalRequests;
@@ -149,10 +190,11 @@ export class LoadTestHistoryPage implements OnInit {
return codes;
}
normalizarFecha(fecha: string): string {
- const [year, month, day] = fecha.split('-').map(num => parseInt(num, 10)); // Convertimos a números para evitar ceros iniciales incorrectos
+ console.log('fecha',fecha);
+ const [year, month, day, hour, minute, second] = fecha.split('-').map(num => parseInt(num, 10)); // Convertimos a números para evitar ceros iniciales incorrectos
const mesNormalizado = month < 10 ? `0${month}` : month.toString(); // Agregar 0 si es necesario
const diaNormalizado = day < 10 ? `0${day}` : day.toString(); // Agregar 0 si es necesario
- return `${year}-${mesNormalizado}-${diaNormalizado}`;
+ return `${year}-${mesNormalizado}-${diaNormalizado} ${hour}:${minute}:${second}`;
}
ordenarDiccionarioPorFechas(diccionario: { [key: string]: any }): { [key: string]: any } {
// Obtener las claves del diccionario (fechas)
@@ -160,6 +202,8 @@ export class LoadTestHistoryPage implements OnInit {
// Ordenar las fechas normalizadas
const fechasOrdenadas = fechas.sort((a, b) => {
+ console.log('a', this.normalizarFecha(a));
+ console.log('b', this.normalizarFecha(b));
const fechaA = new Date(this.normalizarFecha(a));
const fechaB = new Date(this.normalizarFecha(b));
return fechaA.getTime() - fechaB.getTime();
@@ -176,9 +220,12 @@ export class LoadTestHistoryPage implements OnInit {
}
async plotCodes() {
let codes = this.byCodes();
- console.log(codes);
+ console.log('codess',codes);
let keys = Object.keys(codes);
+
+ console.log('llaves',keys);
+
let typesOfCodes = new Set() as Set;
for (let key of keys) {
@@ -200,6 +247,7 @@ export class LoadTestHistoryPage implements OnInit {
}
}
+
let colors = [
'#36b311',
'#306fc6',
@@ -373,9 +421,74 @@ export class LoadTestHistoryPage implements OnInit {
responseTimeChart!.style.width = '100%';
responseTimeChart!.style.height = '25em';
+
+ return responseTimes;
+
+ }
+
+
+
+ async toggleAiModal(context?: string) {
+ await this.showLoading()
+
+ this.aiModal = !this.aiModal;
+ this.hasBeenOpened = true;
+
+ if (context === 'httpCodesOptions') {
+ this.message = 'En este caso el json tiene codigos de respuesta HTTP, por ejemplo, 404, 500, etc y cuantos requests devolvieron esos codigos:' + JSON.stringify(this.byCodes())
+ }
+ if (context === 'httpResponseTimeOptions') {
+ this.message = 'En este caso el json tiene tiempos de respuesta de los requests, por ejemplo, 500ms, 1000ms, etc: ' + JSON.stringify(this.responseTime())
+ }
+
+ if (this.message === '') {
+ console.log('Message is empty');
+ await this.hideLoading();
+ return;
+ }
+
+ let length = this.messages.length;
+ if (length > 0) {
+ this.messages.push({message: this.message, from: 'User', id: length.toString()});
+ }
+ const result = await this.chat.sendMessage(this.message);
+ length = this.messages.length;
+ this.messages.push({message: result.response.text(), from: 'AI', id: length.toString()});
+ this.message = '';
+ await this.hideLoading();
+ return;
+
+
}
+ sendMessage() {
+ let length = this.messages.length;
+ this.messages.push({message: this.message, from: 'User', id: length.toString()});
+ this.chat.sendMessage(this.message).then(async (result) => {
+ await this.showLoading()
+ length = this.messages.length;
+ this.messages.push({message: result.response.text(), from: 'AI', id: length.toString()});
+ await this.hideLoading();
+ });
+ this.message = '';
+ return;
+ }
+ /**
+ * Show a loading spinner.
+ */
+ async showLoading() {
+ const loading = await this.loadingCtrl.create({
+ });
+ await loading.present();
+ }
+
+ /**
+ * Hide the loading spinner.
+ */
+ async hideLoading() {
+ await this.loadingCtrl.dismiss();
+ }
}
diff --git a/src/app/pages/load_test/load-test/load-test.page.html b/src/app/pages/load_test/load-test/load-test.page.html
index 2f9e4c2..7d0a74d 100644
--- a/src/app/pages/load_test/load-test/load-test.page.html
+++ b/src/app/pages/load_test/load-test/load-test.page.html
@@ -34,10 +34,10 @@
{{ totalNumberOfRequests | number:'1.0-0' }}
-
-
-
-
+
+
+
+
@@ -52,10 +52,10 @@
{{ totalNumberOfRequests | number:'1.0-0' }}
-
-
-
-
+
+
+
+
@@ -84,12 +84,13 @@
{{ totalNumberOfRequests | number:'1.0-0' }}
-
+ @if(hasBeenOpened){
-
+
+ }
diff --git a/src/app/pages/load_test/load-test/load-test.page.ts b/src/app/pages/load_test/load-test/load-test.page.ts
index 56ee2fb..b435913 100644
--- a/src/app/pages/load_test/load-test/load-test.page.ts
+++ b/src/app/pages/load_test/load-test/load-test.page.ts
@@ -91,6 +91,7 @@ responseTimeOptions: EChartsOption = {
],
});
messages:AiMessage[] = []
+ hasBeenOpened = false;
@@ -175,7 +176,7 @@ responseTimeOptions: EChartsOption = {
// @ts-ignore: Extrae la fecha del resultado
let date = this.loadTestResults[key].date;
// Filtra las claves que empiezan con "http.requests."
- let httpCodesKeys = Object.keys(data).filter(keyCode => keyCode.startsWith('http.requests'));
+ let httpCodesKeys = Object.keys(data).filter(keyCode => keyCode.startsWith('http.responses'));
for (let keyCode of httpCodesKeys) {
if (!requests[date]) {
@@ -187,7 +188,7 @@ responseTimeOptions: EChartsOption = {
}
for (let date of Object.keys(requests)) {
- totalRequests += requests[date]['http.requests'];
+ totalRequests += requests[date]['http.responses'];
}
this.totalNumberOfRequests = totalRequests;
@@ -522,7 +523,10 @@ for (let metric in total) {
async toggleAiModal(context?: string) {
+ await this.showLoading()
+
this.aiModal = !this.aiModal;
+ this.hasBeenOpened = true;
if (context === 'httpCodesOptions') {
this.message = 'En este caso el json tiene codigos de respuesta HTTP, por ejemplo, 404, 500, etc y cuantos requests devolvieron esos codigos:' + JSON.stringify(this.byCodes())
@@ -533,6 +537,7 @@ for (let metric in total) {
if (this.message === '') {
console.log('Message is empty');
+ await this.hideLoading();
return;
}
@@ -544,6 +549,7 @@ for (let metric in total) {
length = this.messages.length;
this.messages.push({message: result.response.text(), from: 'AI', id: length.toString()});
this.message = '';
+ await this.hideLoading();
return;
@@ -552,9 +558,11 @@ for (let metric in total) {
sendMessage() {
let length = this.messages.length;
this.messages.push({message: this.message, from: 'User', id: length.toString()});
- this.chat.sendMessage(this.message).then((result) => {
+ this.chat.sendMessage(this.message).then(async (result) => {
+ await this.showLoading()
length = this.messages.length;
this.messages.push({message: result.response.text(), from: 'AI', id: length.toString()});
+ await this.hideLoading();
});
this.message = '';
return;
diff --git a/www/4304.1ee0ef2bdf588c3d.js b/www/4304.1ee0ef2bdf588c3d.js
deleted file mode 100644
index c1fe58c..0000000
--- a/www/4304.1ee0ef2bdf588c3d.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4304],{5553:(L,v,a)=>{a.d(v,{h:()=>O});var d=a(177),j=a(7863),c=a(4438);let O=(()=>{var f;class t{}return(f=t).\u0275fac=function(T){return new(T||f)},f.\u0275mod=c.$C({type:f}),f.\u0275inj=c.G2t({imports:[d.MD,j.bv]}),t})()},3241:(L,v,a)=>{a.d(v,{p:()=>O});var d=a(4438),j=a(177),c=a(7863);let O=(()=>{var f;class t{constructor(T){this.location=T,this.title="Header Title"}ngOnInit(){}goBack(){this.location.back()}}return(f=t).\u0275fac=function(T){return new(T||f)(d.rXU(j.aZ))},f.\u0275cmp=d.VBU({type:f,selectors:[["app-header-return"]],inputs:{title:"title"},decls:6,vars:2,consts:[[3,"translucent"],["slot","start","menu","menu-id"],["name","arrow-back","slot","start",1,"p-4","bigger-icon",3,"click"]],template:function(T,b){1&T&&(d.j41(0,"ion-header",0)(1,"ion-toolbar"),d.nrm(2,"ion-menu-button",1),d.j41(3,"ion-icon",2),d.bIt("click",function(){return b.goBack()}),d.k0s(),d.j41(4,"ion-title"),d.EFF(5),d.k0s()()()),2&T&&(d.Y8G("translucent",!0),d.R7$(5),d.JRh(b.title))},dependencies:[c.eU,c.iq,c.MC,c.BC,c.ai],styles:[".bigger-icon[_ngcontent-%COMP%]{font-size:1.5em}"]}),t})()},4304:(L,v,a)=>{a.r(v),a.d(v,{LoadTestHistoryPageModule:()=>A});var d=a(177),j=a(4341),c=a(7863),O=a(7650),f=a(467),t=a(4438),R=a(4970),T=a(8453),b=a(3241),F=a(2820);const x=[{path:"",component:(()=>{var i;class C{constructor(o,e,s){this.activatedRoute=o,this.router=e,this.loadTestService=s,this.productObjective="",this.productStep="",this.orgName="",this.date="",this.loadTestResults={},this.totalNumberOfRequests=0,this.statusCodesOptions={tooltip:{trigger:"axis"},xAxis:{type:"category",boundaryGap:!1,data:[]},yAxis:{type:"value"},series:[]},this.responseTimeOptions={tooltip:{trigger:"axis"},xAxis:{type:"category",boundaryGap:!1,data:[]},yAxis:{type:"value"},series:[]}}ngOnInit(){var o=this;this.getParams(),this.getLoadTestHistoryByDate().then(function(){var e=(0,f.A)(function*(s){o.totalRequests(),yield o.plotCodes(),yield o.responseTime()});return function(s){return e.apply(this,arguments)}}())}getParams(){this.activatedRoute.params.subscribe(e=>{this.productObjective=e.productObjective,this.productStep=e.productStep,this.date=e.day});const o=JSON.parse(localStorage.getItem("user"));this.orgName=o.orgName,console.log(this.orgName),console.log(this.productObjective),console.log(this.productStep),console.log(this.date)}getLoadTestHistoryByDate(){var o=this;return(0,f.A)(function*(){o.loadTestResults=yield o.loadTestService.getLoadTestHistoryByDate(o.orgName,o.productObjective,o.productStep,o.date)})()}totalRequests(){let o=Object.keys(this.loadTestResults),e={},s=0;for(let r of o){let n=this.loadTestResults[r].aggregate.counters,u=this.loadTestResults[r].date,y=Object.keys(n).filter(p=>p.startsWith("http.requests"));for(let p of y)e[u]||(e[u]={}),e[u][p]=(e[u][p]||0)+n[p]}for(let r of Object.keys(e))s+=e[r]["http.requests"];this.totalNumberOfRequests=s}byCodes(){let o=Object.keys(this.loadTestResults),e={};for(let s of o){let r=this.loadTestResults[s].aggregate.counters,n=this.loadTestResults[s].date,u=Object.keys(r).filter(y=>y.startsWith("http.codes."));for(let y of u)e[n]||(e[n]={}),e[n][y]=r[y]}return console.log(e),e=this.ordenarDiccionarioPorFechas(e),e}normalizarFecha(o){const[e,s,r]=o.split("-").map(y=>parseInt(y,10));return`${e}-${s<10?`0${s}`:s.toString()}-${r<10?`0${r}`:r.toString()}`}ordenarDiccionarioPorFechas(o){const s=Object.keys(o).sort((n,u)=>{const y=new Date(this.normalizarFecha(n)),p=new Date(this.normalizarFecha(u));return y.getTime()-p.getTime()}),r={};return s.forEach(n=>{r[n]=o[n]}),r}plotCodes(){var o=this;return(0,f.A)(function*(){let e=o.byCodes();console.log(e);let s=Object.keys(e),r=new Set;for(let p of s){let h=Object.keys(e[p]);for(let M of h)r.add(M)}let n={};for(let p in e){let l=e[p];for(let h of r)n[h]||(n[h]=[]),n[h].push(l[h]||0)}let u=["#36b311","#306fc6","#ed3b3b","#f4ba20"];for(let p in n){let h,l=p.split(".").pop();null!=l&&l.startsWith("2")&&(h=u[0]),null!=l&&l.startsWith("3")&&(h=u[1]),null!=l&&l.startsWith("4")&&(h=u[2]),null!=l&&l.startsWith("5")&&(h=u[3]),h||(h="#000000"),o.statusCodesOptions.series.push({name:p,type:"line",data:n[p],lineStyle:{color:h},itemStyle:{color:h}})}o.statusCodesOptions.xAxis={type:"category",boundaryGap:!1,data:s},o.statusCodesOptions={...o.statusCodesOptions};let y=document.getElementById("httpCodesChartHistory");console.log(y),y.style.width="100%",y.style.height="25em"})()}responseTime(){let o=Object.keys(this.loadTestResults),e={};for(let g of o){let m=this.loadTestResults[g].aggregate.histograms,k=this.loadTestResults[g].date,D=Object.keys(m).filter(H=>H.startsWith("http.response_time"));for(let H of D)e[k]=m[H]}let s=Object.keys(e);s=function r(g){return g.sort((m,k)=>{let D=m.split("-").slice(0,3).join("/"),H=k.split("-").slice(0,3).join("/"),S=m.split("-").slice(3,6).join(":"),$=H+" "+k.split("-").slice(3,6).join(":");return new Date(D+" "+S).getTime()-new Date($).getTime()})}(s),console.log("date",s),console.log("responseTimes",e);let n=[],u=[],y=[],p=[],l=[],h=[];for(let g in s){console.log("date",s[g]);for(let m in e[s[g]])"min"===m&&n.push(e[s[g]][m]),"max"===m&&u.push(e[s[g]][m]),"p95"===m&&y.push(e[s[g]][m]),"p99"===m&&p.push(e[s[g]][m]),"mean"===m&&l.push(e[s[g]][m]),"median"===m&&h.push(e[s[g]][m])}console.log("min",n);let M={min:n,max:u,p95:y,p99:p,mean:l,median:h};this.responseTimeOptions.series=[];for(let g in M)this.responseTimeOptions.series.push({name:g,type:"bar",data:M[g]});this.responseTimeOptions.xAxis={type:"category",boundaryGap:!1,data:s},this.responseTimeOptions={...this.responseTimeOptions};let E=document.getElementById("httpResponseTimeChartHistory");console.log(E),E.style.width="100%",E.style.height="25em"}}return(i=C).\u0275fac=function(o){return new(o||i)(t.rXU(O.nX),t.rXU(O.Ix),t.rXU(R.s))},i.\u0275cmp=t.VBU({type:i,selectors:[["app-load-test-history"]],decls:28,vars:9,consts:[[3,"title"],[3,"fullscreen"],[1,"lg:m-10","md:m-10"],["size","12",1,"w-full"],[1,"w-full","p-6","flex","flex-col","justify-center","items-center"],[1,"text-3xl"],[1,"text-2xl","text-white"],[1,"h-[25em]","w-full"],["id","httpCodesChartHistory","echarts","",1,"demo-chart","h-full","w-full",3,"options"],["id","httpResponseTimeChartHistory","echarts","",1,"demo-chart","h-full","w-full",3,"options"]],template:function(o,e){1&o&&(t.nrm(0,"app-header-return",0),t.j41(1,"ion-content",1)(2,"ion-grid"),t.nrm(3,"app-title",0),t.j41(4,"ion-row",2)(5,"ion-col",3)(6,"ion-card",4)(7,"ion-card-header")(8,"ion-card-title",5),t.EFF(9,"Total Number of Requests"),t.k0s()(),t.j41(10,"ion-card-content")(11,"h1",6),t.EFF(12),t.nI1(13,"number"),t.k0s()()()()(),t.j41(14,"ion-row",2)(15,"ion-card",4)(16,"ion-card-header")(17,"ion-card-title",5),t.EFF(18,"HTTP Status Codes"),t.k0s()(),t.j41(19,"ion-card-content",7),t.nrm(20,"div",8),t.k0s()()(),t.j41(21,"ion-row",2)(22,"ion-card",4)(23,"ion-card-header")(24,"ion-card-title",5),t.EFF(25,"HTTP Response Time"),t.k0s()(),t.j41(26,"ion-card-content",7),t.nrm(27,"div",9),t.k0s()()()()()),2&o&&(t.Y8G("title","History For: "+e.date),t.R7$(),t.Y8G("fullscreen",!0),t.R7$(2),t.Y8G("title","Load Test History"),t.R7$(9),t.JRh(t.i5U(13,6,e.totalNumberOfRequests,"1.0-0")),t.R7$(8),t.Y8G("options",e.statusCodesOptions),t.R7$(7),t.Y8G("options",e.responseTimeOptions))},dependencies:[c.b_,c.I9,c.ME,c.tN,c.hU,c.W9,c.lO,c.ln,T.W,b.p,F.$P,d.QX]}),C})()}];let I=(()=>{var i;class C{}return(i=C).\u0275fac=function(o){return new(o||i)},i.\u0275mod=t.$C({type:i}),i.\u0275inj=t.G2t({imports:[O.iI.forChild(x),O.iI]}),C})();var B=a(5553);let A=(()=>{var i;class C{}return(i=C).\u0275fac=function(o){return new(o||i)},i.\u0275mod=t.$C({type:i}),i.\u0275inj=t.G2t({imports:[d.MD,j.YN,c.bv,I,B.h]}),C})()}}]);
\ No newline at end of file
diff --git a/www/4304.5e919bf908d2ac02.js b/www/4304.5e919bf908d2ac02.js
new file mode 100644
index 0000000..e5d87ac
--- /dev/null
+++ b/www/4304.5e919bf908d2ac02.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4304],{5553:(w,_,r)=>{r.d(_,{h:()=>j});var c=r(177),x=r(7863),l=r(4438);let j=(()=>{var u;class e{}return(u=e).\u0275fac=function(b){return new(b||u)},u.\u0275mod=l.$C({type:u}),u.\u0275inj=l.G2t({imports:[c.MD,x.bv]}),e})()},3241:(w,_,r)=>{r.d(_,{p:()=>j});var c=r(4438),x=r(177),l=r(7863);let j=(()=>{var u;class e{constructor(b){this.location=b,this.title="Header Title"}ngOnInit(){}goBack(){this.location.back()}}return(u=e).\u0275fac=function(b){return new(b||u)(c.rXU(x.aZ))},u.\u0275cmp=c.VBU({type:u,selectors:[["app-header-return"]],inputs:{title:"title"},decls:6,vars:2,consts:[[3,"translucent"],["slot","start","menu","menu-id"],["name","arrow-back","slot","start",1,"p-4","bigger-icon",3,"click"]],template:function(b,O){1&b&&(c.j41(0,"ion-header",0)(1,"ion-toolbar"),c.nrm(2,"ion-menu-button",1),c.j41(3,"ion-icon",2),c.bIt("click",function(){return O.goBack()}),c.k0s(),c.j41(4,"ion-title"),c.EFF(5),c.k0s()()()),2&b&&(c.Y8G("translucent",!0),c.R7$(5),c.JRh(O.title))},dependencies:[l.eU,l.iq,l.MC,l.BC,l.ai],styles:[".bigger-icon[_ngcontent-%COMP%]{font-size:1.5em}"]}),e})()},4304:(w,_,r)=>{r.r(_),r.d(_,{LoadTestHistoryPageModule:()=>z});var c=r(177),x=r(4341),l=r(7863),j=r(7650),u=r(467),e=r(4438),C=r(9032),b=r(4970),O=r(8453),L=r(3241),A=r(2820),E=r(9549);const F=["messagesContainer"];function I(i,T){if(1&i){const f=e.RV6();e.j41(0,"ion-fab",30),e.bIt("click",function(){e.eBV(f);const t=e.XpG();return e.Njj(t.toggleAiModal())}),e.j41(1,"ion-avatar",31),e.nrm(2,"ion-icon",32),e.k0s()()}}function D(i,T){if(1&i&&(e.j41(0,"div",36)(1,"markdown",37),e.EFF(2),e.k0s()()),2&i){const f=e.XpG().$implicit;e.R7$(2),e.JRh(f.message)}}function N(i,T){if(1&i&&(e.j41(0,"div",38)(1,"markdown",39),e.EFF(2),e.k0s()()),2&i){const f=e.XpG().$implicit;e.R7$(),e.Mz_("id","mk-",f.id,""),e.R7$(),e.JRh(f.message)}}function B(i,T){if(1&i&&(e.j41(0,"div",33),e.DNE(1,D,3,1,"div",34)(2,N,3,3,"div",35),e.k0s()),2&i){const f=T.$implicit;e.R7$(),e.Y8G("ngIf","User"===f.from),e.R7$(),e.Y8G("ngIf","AI"===f.from)}}const $=[{path:"",component:(()=>{var i;class T{constructor(s,t,o,n){this.activatedRoute=s,this.router=t,this.loadTestService=o,this.loadingCtrl=n,this.productObjective="",this.productStep="",this.orgName="",this.date="",this.loadTestResults={},this.totalNumberOfRequests=0,this.statusCodesOptions={tooltip:{trigger:"axis"},xAxis:{type:"category",boundaryGap:!1,data:[]},yAxis:{type:"value"},series:[]},this.responseTimeOptions={tooltip:{trigger:"axis"},xAxis:{type:"category",boundaryGap:!1,data:[]},yAxis:{type:"value"},series:[]},this.aiModal=!1,this.message="",this.vertexAI=(0,e.WQX)(C.L9),this.model=(0,C.oc)(this.vertexAI,{model:"gemini-1.5-flash"}),this.chat=this.model.startChat({history:[{role:"user",parts:[{text:"Hola, desde ahora en adelante quiero que seas un modelo experto en Software Quality Assurance y analista de datos, tu nombre es DevProbeAI, nunca lo puedes olvidar"}]},{role:"model",parts:[{text:"Soy un modelo experto en Software Quality Assurance, de igual forma tengo un masterado en anla\xedtica de datos \xbfEn qu\xe9 puedo ayudarte?"}]},{role:"user",parts:[{text:"Gracias, te voy a entregar un json con datos en unos minutos, necesito que lo analices y me des un resumen de los datos, este json contiene datos de un load test,tu analisis tiene que ser detallado, si encuentras inconsistencias en los datos, por favor mencionalas, en caso de que creas que puede haber un problema o que se encuentre el recurso no disponible por favor mencionalo, si encuentras algo interesante, por favor mencionalo, en resumen, necesito un analisis detallado de los datos"}]},{role:"model",parts:[{text:"Claro, env\xedame el json y yo me encargo de analizarlo"}]}]}),this.messages=[],this.hasBeenOpened=!1}ngOnInit(){var s=this;this.getParams(),this.getLoadTestHistoryByDate().then(function(){var t=(0,u.A)(function*(o){s.totalRequests(),yield s.plotCodes(),yield s.responseTime()});return function(o){return t.apply(this,arguments)}}())}getParams(){this.activatedRoute.params.subscribe(t=>{this.productObjective=t.productObjective,this.productStep=t.productStep,this.date=t.day});const s=JSON.parse(localStorage.getItem("user"));this.orgName=s.orgName,console.log(this.orgName),console.log(this.productObjective),console.log(this.productStep),console.log(this.date)}getLoadTestHistoryByDate(){var s=this;return(0,u.A)(function*(){s.loadTestResults=yield s.loadTestService.getLoadTestHistoryByDate(s.orgName,s.productObjective,s.productStep,s.date)})()}totalRequests(){let s=Object.keys(this.loadTestResults),t={},o=0;for(let n of s){let a=this.loadTestResults[n].aggregate.counters,p=this.loadTestResults[n].date,y=Object.keys(a).filter(m=>m.startsWith("http.responses"));for(let m of y)t[p]||(t[p]={}),t[p][m]=(t[p][m]||0)+a[m]}for(let n of Object.keys(t))o+=t[n]["http.responses"];this.totalNumberOfRequests=o}byCodes(){let s=Object.keys(this.loadTestResults),t={};for(let o of s){let n=this.loadTestResults[o].aggregate.counters,a=this.loadTestResults[o].date,p=Object.keys(n).filter(y=>y.startsWith("http.codes."));for(let y of p)t[a]||(t[a]={}),t[a][y]=n[y]}return console.log(t),t=this.ordenarDiccionarioPorFechas(t),t}normalizarFecha(s){console.log("fecha",s);const[t,o,n,a,p,y]=s.split("-").map(g=>parseInt(g,10));return`${t}-${o<10?`0${o}`:o.toString()}-${n<10?`0${n}`:n.toString()} ${a}:${p}:${y}`}ordenarDiccionarioPorFechas(s){const o=Object.keys(s).sort((a,p)=>{console.log("a",this.normalizarFecha(a)),console.log("b",this.normalizarFecha(p));const y=new Date(this.normalizarFecha(a)),m=new Date(this.normalizarFecha(p));return y.getTime()-m.getTime()}),n={};return o.forEach(a=>{n[a]=s[a]}),n}plotCodes(){var s=this;return(0,u.A)(function*(){let t=s.byCodes();console.log("codess",t);let o=Object.keys(t);console.log("llaves",o);let n=new Set;for(let m of o){let g=Object.keys(t[m]);for(let k of g)n.add(k)}let a={};for(let m in t){let d=t[m];for(let g of n)a[g]||(a[g]=[]),a[g].push(d[g]||0)}let p=["#36b311","#306fc6","#ed3b3b","#f4ba20"];for(let m in a){let g,d=m.split(".").pop();null!=d&&d.startsWith("2")&&(g=p[0]),null!=d&&d.startsWith("3")&&(g=p[1]),null!=d&&d.startsWith("4")&&(g=p[2]),null!=d&&d.startsWith("5")&&(g=p[3]),g||(g="#000000"),s.statusCodesOptions.series.push({name:m,type:"line",data:a[m],lineStyle:{color:g},itemStyle:{color:g}})}s.statusCodesOptions.xAxis={type:"category",boundaryGap:!1,data:o},s.statusCodesOptions={...s.statusCodesOptions};let y=document.getElementById("httpCodesChartHistory");console.log(y),y.style.width="100%",y.style.height="25em"})()}responseTime(){let s=Object.keys(this.loadTestResults),t={};for(let v of s){let h=this.loadTestResults[v].aggregate.histograms,M=this.loadTestResults[v].date,H=Object.keys(h).filter(R=>R.startsWith("http.response_time"));for(let R of H)t[M]=h[R]}let o=Object.keys(t);o=function n(v){return v.sort((h,M)=>{let H=h.split("-").slice(0,3).join("/"),R=M.split("-").slice(0,3).join("/"),U=h.split("-").slice(3,6).join(":"),V=R+" "+M.split("-").slice(3,6).join(":");return new Date(H+" "+U).getTime()-new Date(V).getTime()})}(o),console.log("date",o),console.log("responseTimes",t);let a=[],p=[],y=[],m=[],d=[],g=[];for(let v in o){console.log("date",o[v]);for(let h in t[o[v]])"min"===h&&a.push(t[o[v]][h]),"max"===h&&p.push(t[o[v]][h]),"p95"===h&&y.push(t[o[v]][h]),"p99"===h&&m.push(t[o[v]][h]),"mean"===h&&d.push(t[o[v]][h]),"median"===h&&g.push(t[o[v]][h])}console.log("min",a);let k={min:a,max:p,p95:y,p99:m,mean:d,median:g};this.responseTimeOptions.series=[];for(let v in k)this.responseTimeOptions.series.push({name:v,type:"bar",data:k[v]});this.responseTimeOptions.xAxis={type:"category",boundaryGap:!1,data:o},this.responseTimeOptions={...this.responseTimeOptions};let P=document.getElementById("httpResponseTimeChartHistory");return console.log(P),P.style.width="100%",P.style.height="25em",t}toggleAiModal(s){var t=this;return(0,u.A)(function*(){if(yield t.showLoading(),t.aiModal=!t.aiModal,t.hasBeenOpened=!0,"httpCodesOptions"===s&&(t.message="En este caso el json tiene codigos de respuesta HTTP, por ejemplo, 404, 500, etc y cuantos requests devolvieron esos codigos:"+JSON.stringify(t.byCodes())),"httpResponseTimeOptions"===s&&(t.message="En este caso el json tiene tiempos de respuesta de los requests, por ejemplo, 500ms, 1000ms, etc: "+JSON.stringify(t.responseTime())),""===t.message)return console.log("Message is empty"),void(yield t.hideLoading());let o=t.messages.length;o>0&&t.messages.push({message:t.message,from:"User",id:o.toString()});const n=yield t.chat.sendMessage(t.message);o=t.messages.length,t.messages.push({message:n.response.text(),from:"AI",id:o.toString()}),t.message="",yield t.hideLoading()})()}sendMessage(){var s=this;let t=this.messages.length;this.messages.push({message:this.message,from:"User",id:t.toString()}),this.chat.sendMessage(this.message).then(function(){var o=(0,u.A)(function*(n){yield s.showLoading(),t=s.messages.length,s.messages.push({message:n.response.text(),from:"AI",id:t.toString()}),yield s.hideLoading()});return function(n){return o.apply(this,arguments)}}()),this.message=""}showLoading(){var s=this;return(0,u.A)(function*(){yield(yield s.loadingCtrl.create({})).present()})()}hideLoading(){var s=this;return(0,u.A)(function*(){yield s.loadingCtrl.dismiss()})()}}return(i=T).\u0275fac=function(s){return new(s||i)(e.rXU(j.nX),e.rXU(j.Ix),e.rXU(b.s),e.rXU(l.Xi))},i.\u0275cmp=e.VBU({type:i,selectors:[["app-load-test-history"]],viewQuery:function(s,t){if(1&s&&e.GBs(F,5),2&s){let o;e.mGM(o=e.lsd())&&(t.messagesContainer=o.first)}},decls:55,vars:14,consts:[["messagesContainer",""],[3,"title"],[3,"fullscreen"],[1,"lg:m-10","md:m-10"],["size","12",1,"w-full"],[1,"w-full","p-6","flex","flex-col","justify-center","items-center"],[1,"text-3xl"],[1,"text-2xl","text-white"],["size","12",1,"relative","flex","flex-row","justify-center"],[1,"absolute","z-10","w-full","flex","flex-row","justify-end"],[1,"h-12","w-12","bg-purple-400","p-2",3,"click"],["name","color-wand-outline",1,"w-full","h-full"],[1,"h-[25em]","w-full"],["id","httpCodesChartHistory","echarts","",1,"demo-chart","h-full","w-full",3,"options"],["id","httpResponseTimeChartHistory","echarts","",1,"demo-chart","h-full","w-full",3,"options"],["vertical","bottom","horizontal","end","slot","fixed",1,"m-2","z-10"],["id","ai-modal",1,"fixed","bottom-0","right-0","h-full","w-full","bg-black","bg-opacity-60","z-10","r"],[1,"h-full","md:h-3/4","lg:h-3/4","w-full","bg-gray-900","p-4","absolute","right-0","bottom-0","z-50","flex","flex-col","rounded-tl-2xl","rounded-tr-2xl"],[1,"w-full","bg-gray-500","flex","flex-row","justify-center","items-center","p-2","mb-2","rounded-3xl"],[1,"flex","flex-row","p-2","items-center","bg-gray-800","w-full","rounded-3xl","h-full"],[1,"text-white"],[1,"m-2"],[1,"flex","flex-row","justify-center","items-center","bg-gray-800","hover:bg-gray-600","w-1/6","h-full","rounded-3xl",3,"click"],["name","close-outline"],[1,"flex-grow","overflow-y-auto","bg-gray-400","p-2","rounded-3xl"],["class","flex flex-col",4,"ngFor","ngForOf"],[1,"flex","flex-row","mt-2","p-2"],["placeholder","Ask...",1,"flex-grow","bg-gray-700","rounded-2xl",3,"ngModelChange","ngModel"],[1,"m-1"],[1,"w-1/3","bg-gray-500","rounded-3xl","flex","flex-row","justify-center","items-center","hover:bg-gray-300",3,"click"],["vertical","bottom","horizontal","end","slot","fixed",1,"m-2","z-10",3,"click"],[1,"bg-purple-300","p-1","lg:p-4","md:p-4"],["name","chatbubble-outline",1,"w-full","h-full"],[1,"flex","flex-col"],["class","rounded-3xl bg-gray-800 w-2/3 m-1 ml-auto p-2",4,"ngIf"],["class","rounded-3xl bg-gray-500 w-2/3 m-1 p-2 pr-2",4,"ngIf"],[1,"rounded-3xl","bg-gray-800","w-2/3","m-1","ml-auto","p-2"],[1,"text-white","p-4","m-2"],[1,"rounded-3xl","bg-gray-500","w-2/3","m-1","p-2","pr-2"],[1,"text-white","p-4","m-2",3,"id"]],template:function(s,t){if(1&s){const o=e.RV6();e.nrm(0,"app-header-return",1),e.j41(1,"ion-content",2)(2,"ion-grid"),e.nrm(3,"app-title",1),e.j41(4,"ion-row",3)(5,"ion-col",4)(6,"ion-card",5)(7,"ion-card-header")(8,"ion-card-title",6),e.EFF(9,"Total Number of Requests"),e.k0s()(),e.j41(10,"ion-card-content")(11,"h1",7),e.EFF(12),e.nI1(13,"number"),e.k0s()()()()(),e.j41(14,"ion-row",3)(15,"ion-col",8)(16,"div",9)(17,"ion-avatar",10),e.bIt("click",function(){return e.eBV(o),e.Njj(t.toggleAiModal("httpCodesOptions"))}),e.nrm(18,"ion-icon",11),e.k0s()(),e.j41(19,"ion-card",5)(20,"ion-card-header")(21,"ion-card-title",6),e.EFF(22,"HTTP Status Codes"),e.k0s()(),e.j41(23,"ion-card-content",12),e.nrm(24,"div",13),e.k0s()()()(),e.j41(25,"ion-row",3)(26,"ion-col",8)(27,"div",9)(28,"ion-avatar",10),e.bIt("click",function(){return e.eBV(o),e.Njj(t.toggleAiModal("httpResponseTimeOptions"))}),e.nrm(29,"ion-icon",11),e.k0s()(),e.j41(30,"ion-card",5)(31,"ion-card-header")(32,"ion-card-title",6),e.EFF(33,"HTTP Response Time"),e.k0s()(),e.j41(34,"ion-card-content",12),e.nrm(35,"div",14),e.k0s()()()()(),e.DNE(36,I,3,0,"ion-fab",15),e.k0s(),e.j41(37,"div",16)(38,"div",17)(39,"div",18)(40,"div",19)(41,"h1",20),e.EFF(42,"DevProbe AI"),e.k0s()(),e.nrm(43,"div",21),e.j41(44,"div",22),e.bIt("click",function(){return e.eBV(o),e.Njj(t.toggleAiModal())}),e.nrm(45,"ion-icon",23),e.k0s()(),e.j41(46,"div",24,0),e.DNE(48,B,3,2,"div",25),e.k0s(),e.j41(49,"div",26)(50,"ion-textarea",27),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(t.message,a)||(t.message=a),e.Njj(a)}),e.k0s(),e.nrm(51,"div",28),e.j41(52,"div",29),e.bIt("click",function(){return e.eBV(o),e.Njj(t.sendMessage())}),e.j41(53,"span",20),e.EFF(54,"Send"),e.k0s()()()()()}2&s&&(e.Y8G("title","History For: "+t.date),e.R7$(),e.Y8G("fullscreen",!0),e.R7$(2),e.Y8G("title","Load Test History"),e.R7$(9),e.JRh(e.i5U(13,11,t.totalNumberOfRequests,"1.0-0")),e.R7$(12),e.Y8G("options",t.statusCodesOptions),e.R7$(11),e.Y8G("options",t.responseTimeOptions),e.R7$(),e.vxM(36,t.hasBeenOpened?36:-1),e.R7$(),e.AVh("hidden",!t.aiModal),e.R7$(11),e.Y8G("ngForOf",t.messages),e.R7$(2),e.R50("ngModel",t.message))},dependencies:[c.Sq,c.bT,x.BC,x.vS,l.mC,l.b_,l.I9,l.ME,l.tN,l.hU,l.W9,l.Q8,l.lO,l.iq,l.ln,l.nc,l.Gw,O.W,L.p,A.$P,E.NN,c.QX]}),T})()}];let S=(()=>{var i;class T{}return(i=T).\u0275fac=function(s){return new(s||i)},i.\u0275mod=e.$C({type:i}),i.\u0275inj=e.G2t({imports:[j.iI.forChild($),j.iI]}),T})();var G=r(5553);let z=(()=>{var i;class T{}return(i=T).\u0275fac=function(s){return new(s||i)},i.\u0275mod=e.$C({type:i}),i.\u0275inj=e.G2t({imports:[c.MD,x.YN,l.bv,S,G.h,E.NN]}),T})()}}]);
\ No newline at end of file
diff --git a/www/4559.303a6d01dbac6106.js b/www/4559.303a6d01dbac6106.js
new file mode 100644
index 0000000..bc22810
--- /dev/null
+++ b/www/4559.303a6d01dbac6106.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4559],{5553:(w,x,u)=>{u.d(x,{h:()=>b});var g=u(177),j=u(7863),d=u(4438);let b=(()=>{var p;class e{}return(p=e).\u0275fac=function(_){return new(_||p)},p.\u0275mod=d.$C({type:p}),p.\u0275inj=d.G2t({imports:[g.MD,j.bv]}),e})()},3241:(w,x,u)=>{u.d(x,{p:()=>b});var g=u(4438),j=u(177),d=u(7863);let b=(()=>{var p;class e{constructor(_){this.location=_,this.title="Header Title"}ngOnInit(){}goBack(){this.location.back()}}return(p=e).\u0275fac=function(_){return new(_||p)(g.rXU(j.aZ))},p.\u0275cmp=g.VBU({type:p,selectors:[["app-header-return"]],inputs:{title:"title"},decls:6,vars:2,consts:[[3,"translucent"],["slot","start","menu","menu-id"],["name","arrow-back","slot","start",1,"p-4","bigger-icon",3,"click"]],template:function(_,O){1&_&&(g.j41(0,"ion-header",0)(1,"ion-toolbar"),g.nrm(2,"ion-menu-button",1),g.j41(3,"ion-icon",2),g.bIt("click",function(){return O.goBack()}),g.k0s(),g.j41(4,"ion-title"),g.EFF(5),g.k0s()()()),2&_&&(g.Y8G("translucent",!0),g.R7$(5),g.JRh(O.title))},dependencies:[d.eU,d.iq,d.MC,d.BC,d.ai],styles:[".bigger-icon[_ngcontent-%COMP%]{font-size:1.5em}"]}),e})()},4559:(w,x,u)=>{u.r(x),u.d(x,{LoadTestPageModule:()=>B});var g=u(177),j=u(4341),d=u(7863),b=u(7650),p=u(467),e=u(4438),R=u(9032),_=u(4970),O=u(8453),M=u(3241),P=u(2820),L=u(9549);const E=["messagesContainer"];function A(l,T){if(1&l){const m=e.RV6();e.j41(0,"ion-item",37),e.bIt("click",function(){const t=e.eBV(m).$implicit,n=e.XpG();return e.Njj(n.viewHistory(t))}),e.j41(1,"ion-label"),e.EFF(2),e.k0s(),e.nrm(3,"ion-icon",38),e.k0s()}if(2&l){const m=T.$implicit;e.R7$(2),e.JRh(m)}}function F(l,T){if(1&l){const m=e.RV6();e.j41(0,"ion-fab",39),e.bIt("click",function(){e.eBV(m);const t=e.XpG();return e.Njj(t.toggleAiModal())}),e.j41(1,"ion-avatar",40),e.nrm(2,"ion-icon",41),e.k0s()()}}function I(l,T){if(1&l&&(e.j41(0,"div",45)(1,"markdown",46),e.EFF(2),e.k0s()()),2&l){const m=e.XpG().$implicit;e.R7$(2),e.JRh(m.message)}}function D(l,T){if(1&l&&(e.j41(0,"div",47)(1,"markdown",48),e.EFF(2),e.k0s()()),2&l){const m=e.XpG().$implicit;e.R7$(),e.Mz_("id","mk-",m.id,""),e.R7$(),e.JRh(m.message)}}function N(l,T){if(1&l&&(e.j41(0,"div",42),e.DNE(1,I,3,1,"div",43)(2,D,3,3,"div",44),e.k0s()),2&l){const m=T.$implicit;e.R7$(),e.Y8G("ngIf","User"===m.from),e.R7$(),e.Y8G("ngIf","AI"===m.from)}}const S=[{path:"",component:(()=>{var l;class T{constructor(s,t,n,a,o){this.router=s,this.activatedRoute=t,this.loadTestService=n,this.loadingCtrl=a,this.alertCtrl=o,this.productStep="",this.productObjective="",this.orgName="",this.target="",this.description="",this.loadTestResults={},this.totalNumberOfRequests=0,this.statusCodesOptions={tooltip:{trigger:"axis"},xAxis:{type:"category",boundaryGap:!1,data:[]},yAxis:{type:"value"},series:[]},this.responseTimeOptions={tooltip:{trigger:"axis"},xAxis:{type:"category",boundaryGap:!1,data:[]},yAxis:{type:"value"},series:[]},this.listOfDates=[],this.aiModal=!1,this.message="",this.vertexAI=(0,e.WQX)(R.L9),this.model=(0,R.oc)(this.vertexAI,{model:"gemini-1.5-flash"}),this.chat=this.model.startChat({history:[{role:"user",parts:[{text:"Hola, desde ahora en adelante quiero que seas un modelo experto en Software Quality Assurance y analista de datos, tu nombre es DevProbeAI, nunca lo puedes olvidar"}]},{role:"model",parts:[{text:"Soy un modelo experto en Software Quality Assurance, de igual forma tengo un masterado en anla\xedtica de datos \xbfEn qu\xe9 puedo ayudarte?"}]},{role:"user",parts:[{text:"Gracias, te voy a entregar un json con datos en unos minutos, necesito que lo analices y me des un resumen de los datos, este json contiene datos de un load test,tu analisis tiene que ser detallado, si encuentras inconsistencias en los datos, por favor mencionalas, en caso de que creas que puede haber un problema o que se encuentre el recurso no disponible por favor mencionalo, si encuentras algo interesante, por favor mencionalo, en resumen, necesito un analisis detallado de los datos"}]},{role:"model",parts:[{text:"Claro, env\xedame el json y yo me encargo de analizarlo"}]}]}),this.messages=[],this.hasBeenOpened=!1}ngOnInit(){}ionViewWillEnter(){var s=this;return(0,p.A)(function*(){yield s.showLoading(),s.getParams(),yield s.getHistoryResults().then(()=>{s.plotCodes(),s.totalRequests(),s.responseTime()}),yield s.hideLoading()})()}getParams(){this.activatedRoute.params.subscribe(t=>{this.productObjective=t.productObjective,this.productStep=t.step});const s=JSON.parse(localStorage.getItem("user"));this.orgName=s.orgName,console.log(this.orgName),console.log(this.productObjective),console.log(this.productStep)}sendRequest(){var s=this;return(0,p.A)(function*(){if(yield s.showLoading(),s.target.startsWith("http://")||s.target.startsWith("https://")||s.target.endsWith("/"))return yield s.hideLoading(),void(yield s.showAlert("No http or https is needed, check for slashes at the end of the domain","Please enter a valid host"));yield s.loadTestService.sendLoadTest(s.orgName,s.productObjective,s.productStep,s.target).then(function(){var t=(0,p.A)(function*(n){yield s.hideLoading(),console.log("data",n),n&&(yield s.showAlert("Test sent, please wait a few seconds to GET RESULTS","Success"))});return function(n){return t.apply(this,arguments)}}()),yield s.hideLoading()})()}getHistoryResults(){var s=this;return(0,p.A)(function*(){s.loadTestResults=yield s.loadTestService.getLoadTestHistory(s.orgName,s.productObjective,s.productStep)})()}totalRequests(){let s=Object.keys(this.loadTestResults),t={},n=0;for(let a of s){let o=this.loadTestResults[a].aggregate.counters,v=this.loadTestResults[a].date,c=Object.keys(o).filter(y=>y.startsWith("http.responses"));for(let y of c)t[v]||(t[v]={}),t[v][y]=(t[v][y]||0)+o[y]}for(let a of Object.keys(t))n+=t[a]["http.responses"];this.totalNumberOfRequests=n}byCodes(){let s=Object.keys(this.loadTestResults),t={};for(let n of s){let a=this.loadTestResults[n].aggregate.counters,o=this.loadTestResults[n].date.split("-").slice(0,3).join("-"),v=Object.keys(a).filter(c=>c.startsWith("http.codes."));t[o]||(t[o]={});for(let c of v)t[o][c]=(t[o][c]||0)+a[c]}return t=this.ordenarDiccionarioPorFechas(t),console.log("codessss",t),t}normalizarFecha(s){const[t,n,a]=s.split("-").map(c=>parseInt(c,10));return`${t}-${n<10?`0${n}`:n.toString()}-${a<10?`0${a}`:a.toString()}`}ordenarDiccionarioPorFechas(s){const n=Object.keys(s).sort((o,v)=>{const c=new Date(this.normalizarFecha(o)),y=new Date(this.normalizarFecha(v));return c.getTime()-y.getTime()}),a={};return n.forEach(o=>{a[o]=s[o]}),a}plotCodes(){var s=this;return(0,p.A)(function*(){let t=s.byCodes();console.log(t);let n=Object.keys(t);s.listOfDates=n;let a=new Set;for(let y of n){let i=Object.keys(t[y]);for(let r of i)a.add(r)}let o={};for(let y in t){let h=t[y];for(let i of a)o[i]||(o[i]=[]),o[i].push(h[i]||0)}let v=["#36b311","#306fc6","#ed3b3b","#f4ba20"];for(let y in o){let i,h=y.split(".").pop();null!=h&&h.startsWith("2")&&(i=v[0]),null!=h&&h.startsWith("3")&&(i=v[1]),null!=h&&h.startsWith("4")&&(i=v[2]),null!=h&&h.startsWith("5")&&(i=v[3]),i||(i="#000000"),s.statusCodesOptions.series.push({name:y,type:"line",data:o[y],lineStyle:{color:i},itemStyle:{color:i}})}s.statusCodesOptions.xAxis={type:"category",boundaryGap:!1,data:n},s.statusCodesOptions={...s.statusCodesOptions};let c=document.getElementById("httpCodesChart");console.log(c),c.style.width="100%",c.style.height="25em"})()}responseTime(){let s=Object.keys(this.loadTestResults),t={};for(let i of s){let r=this.loadTestResults[i].aggregate.histograms,C=this.loadTestResults[i].date,f=Object.keys(r).filter(k=>k.startsWith("http.response_time"));for(let k of f)t[C]=r[k]}let n=Object.entries(t).reduce((i,[r,C])=>{const f=r.split("-").slice(0,3).join("-");return i[f]=i[f]||[],i[f].push(C),i},{}),a=Object.keys(n).sort((i,r)=>new Date(i).getTime()-new Date(r).getTime()),o={count:0,max:0,min:0,mean:0,median:0,p50:0,p90:0,p95:0,p99:0,p999:0},v={};a.forEach(i=>{let r={count:0,max:0,min:0,mean:0,median:0,p50:0,p90:0,p95:0,p99:0,p999:0},C=0;n[i].forEach(f=>{r.count+=f.count,r.max+=f.max,r.min+=f.min,r.mean+=f.mean,r.median+=f.median,r.p50+=f.p50,r.p90+=f.p90,r.p95+=f.p95,r.p99+=f.p99,r.p999+=f.p999,C++});for(let f in r)"count"!==f&&C>0&&(r[f]=r[f]/C);v[i]=r,o.count+=r.count,o.max+=r.max,o.min+=r.min,o.mean+=r.mean,o.median+=r.median,o.p50+=r.p50,o.p90+=r.p90,o.p95+=r.p95,o.p99+=r.p99,o.p999+=r.p999});let c=a.length;c>0&&(o.mean/=c,o.median/=c,o.p50/=c,o.p90/=c,o.p95/=c,o.p99/=c,o.p999/=c,o.max/=c,o.min/=c);let y={};for(let i in o)"count"===i||"p90"===i||"p50"===i||"p999"===i||(y[i]=o[i],this.responseTimeOptions.series.push({name:i,type:"bar",data:[o[i]],label:{show:!0,formatter:r=>`${r.value.toFixed(2)} ms`}}));this.responseTimeOptions.xAxis={type:"category",boundaryGap:!1,data:["Category"]},this.responseTimeOptions={...this.responseTimeOptions};let h=document.getElementById("httpResponseTimeChart");return console.log(h),h.style.width="100%",h.style.height="25em",y}showLoading(){var s=this;return(0,p.A)(function*(){yield(yield s.loadingCtrl.create({})).present()})()}hideLoading(){var s=this;return(0,p.A)(function*(){yield s.loadingCtrl.dismiss()})()}showAlert(s,t){var n=this;return(0,p.A)(function*(){const a=yield n.alertCtrl.create({header:t,message:s,buttons:["OK"]});return yield a.present(),yield a.onDidDismiss(),!0})()}viewHistory(s){this.router.navigate(["/load-test-history",{productObjective:this.productObjective,productStep:this.productStep,day:s}])}toggleAiModal(s){var t=this;return(0,p.A)(function*(){if(yield t.showLoading(),t.aiModal=!t.aiModal,t.hasBeenOpened=!0,"httpCodesOptions"===s&&(t.message="En este caso el json tiene codigos de respuesta HTTP, por ejemplo, 404, 500, etc y cuantos requests devolvieron esos codigos:"+JSON.stringify(t.byCodes())),"httpResponseTimeOptions"===s&&(t.message="En este caso el json tiene tiempos de respuesta de los requests, por ejemplo, 500ms, 1000ms, etc: "+JSON.stringify(t.responseTime())),""===t.message)return console.log("Message is empty"),void(yield t.hideLoading());let n=t.messages.length;n>0&&t.messages.push({message:t.message,from:"User",id:n.toString()});const a=yield t.chat.sendMessage(t.message);n=t.messages.length,t.messages.push({message:a.response.text(),from:"AI",id:n.toString()}),t.message="",yield t.hideLoading()})()}sendMessage(){var s=this;let t=this.messages.length;this.messages.push({message:this.message,from:"User",id:t.toString()}),this.chat.sendMessage(this.message).then(function(){var n=(0,p.A)(function*(a){yield s.showLoading(),t=s.messages.length,s.messages.push({message:a.response.text(),from:"AI",id:t.toString()}),yield s.hideLoading()});return function(a){return n.apply(this,arguments)}}()),this.message=""}}return(l=T).\u0275fac=function(s){return new(s||l)(e.rXU(b.Ix),e.rXU(b.nX),e.rXU(_.s),e.rXU(d.Xi),e.rXU(d.hG))},l.\u0275cmp=e.VBU({type:l,selectors:[["app-load-test"]],viewQuery:function(s,t){if(1&s&&e.GBs(E,5),2&s){let n;e.mGM(n=e.lsd())&&(t.messagesContainer=n.first)}},decls:71,vars:18,consts:[["messagesContainer",""],[3,"title"],[3,"fullscreen"],[1,"lg:m-10","md:m-10"],["size","12"],["label","Target","placeholder","Enter a target","type","text","labelPlacement","stacked",1,"",3,"ngModelChange","ngModel"],["size","12","size-md","12","size-lg","12",1,"flex","flex-row","justify-end"],["color","primary","size","small",1,"",3,"click"],["name","add"],[1,"w-full","p-6","flex","flex-col","justify-center","items-center"],[1,"text-3xl"],[1,"text-2xl","text-white"],["size","12",1,"relative","flex","flex-row","justify-center"],[1,"absolute","z-10","w-full","flex","flex-row","justify-end"],[1,"h-12","w-12","bg-purple-400","p-2",3,"click"],["name","color-wand-outline",1,"w-full","h-full"],[1,"h-[25em]","w-full"],["id","httpCodesChart","echarts","",1,"demo-chart","h-full","w-full",3,"options"],["id","httpResponseTimeChart","echarts","",1,"demo-chart","h-full","w-full",3,"options"],["size","12",1,"w-full"],[1,"w-full"],["class","w-full",3,"click",4,"ngFor","ngForOf"],["vertical","bottom","horizontal","end","slot","fixed",1,"m-2","z-10"],["id","ai-modal",1,"fixed","bottom-0","right-0","h-full","w-full","bg-black","bg-opacity-60","z-10","r"],[1,"h-full","md:h-3/4","lg:h-3/4","w-full","bg-gray-900","p-4","absolute","right-0","bottom-0","z-50","flex","flex-col","rounded-tl-2xl","rounded-tr-2xl"],[1,"w-full","bg-gray-500","flex","flex-row","justify-center","items-center","p-2","mb-2","rounded-3xl"],[1,"flex","flex-row","p-2","items-center","bg-gray-800","w-full","rounded-3xl","h-full"],[1,"text-white"],[1,"m-2"],[1,"flex","flex-row","justify-center","items-center","bg-gray-800","hover:bg-gray-600","w-1/6","h-full","rounded-3xl",3,"click"],["name","close-outline"],[1,"flex-grow","overflow-y-auto","bg-gray-400","p-2","rounded-3xl"],["class","flex flex-col",4,"ngFor","ngForOf"],[1,"flex","flex-row","mt-2","p-2"],["placeholder","Ask...",1,"flex-grow","bg-gray-700","rounded-2xl",3,"ngModelChange","ngModel"],[1,"m-1"],[1,"w-1/3","bg-gray-500","rounded-3xl","flex","flex-row","justify-center","items-center","hover:bg-gray-300",3,"click"],[1,"w-full",3,"click"],["name","arrow-forward","color","primary"],["vertical","bottom","horizontal","end","slot","fixed",1,"m-2","z-10",3,"click"],[1,"bg-purple-300","p-1","lg:p-4","md:p-4"],["name","chatbubble-outline",1,"w-full","h-full"],[1,"flex","flex-col"],["class","rounded-3xl bg-gray-800 w-2/3 m-1 ml-auto p-2",4,"ngIf"],["class","rounded-3xl bg-gray-500 w-2/3 m-1 p-2 pr-2",4,"ngIf"],[1,"rounded-3xl","bg-gray-800","w-2/3","m-1","ml-auto","p-2"],[1,"text-white","p-4","m-2"],[1,"rounded-3xl","bg-gray-500","w-2/3","m-1","p-2","pr-2"],[1,"text-white","p-4","m-2",3,"id"]],template:function(s,t){if(1&s){const n=e.RV6();e.nrm(0,"app-header-return",1),e.j41(1,"ion-content",2)(2,"ion-grid"),e.nrm(3,"app-title",1),e.j41(4,"ion-row",3)(5,"ion-col",4)(6,"ion-card")(7,"ion-card-content")(8,"ion-input",5),e.mxI("ngModelChange",function(o){return e.eBV(n),e.DH7(t.target,o)||(t.target=o),e.Njj(o)}),e.k0s()()()()(),e.j41(9,"ion-row",3)(10,"ion-col",6)(11,"ion-button",7),e.bIt("click",function(){return e.eBV(n),e.Njj(t.sendRequest())}),e.EFF(12,"Load Target "),e.nrm(13,"ion-icon",8),e.k0s()()(),e.nrm(14,"app-title",1),e.j41(15,"ion-row",3)(16,"ion-col",4)(17,"ion-card",9)(18,"ion-card-header")(19,"ion-card-title",10),e.EFF(20,"Total Number of Requests"),e.k0s()(),e.j41(21,"ion-card-content")(22,"h1",11),e.EFF(23),e.nI1(24,"number"),e.k0s()()()()(),e.j41(25,"ion-row",3)(26,"ion-col",12)(27,"div",13)(28,"ion-avatar",14),e.bIt("click",function(){return e.eBV(n),e.Njj(t.toggleAiModal("httpCodesOptions"))}),e.nrm(29,"ion-icon",15),e.k0s()(),e.j41(30,"ion-card",9)(31,"ion-card-header")(32,"ion-card-title",10),e.EFF(33,"HTTP Status Codes"),e.k0s()(),e.j41(34,"ion-card-content",16),e.nrm(35,"div",17),e.k0s()()()(),e.j41(36,"ion-row",3)(37,"ion-col",12)(38,"div",13)(39,"ion-avatar",14),e.bIt("click",function(){return e.eBV(n),e.Njj(t.toggleAiModal("httpResponseTimeOptions"))}),e.nrm(40,"ion-icon",15),e.k0s()(),e.j41(41,"ion-card",9)(42,"ion-card-header")(43,"ion-card-title",10),e.EFF(44,"HTTP Response Time"),e.k0s()(),e.j41(45,"ion-card-content",16),e.nrm(46,"div",18),e.k0s()()()(),e.nrm(47,"app-title",1),e.j41(48,"ion-row",3)(49,"ion-col",19)(50,"ion-list",20),e.DNE(51,A,4,1,"ion-item",21),e.k0s()()()(),e.DNE(52,F,3,0,"ion-fab",22),e.k0s(),e.j41(53,"div",23)(54,"div",24)(55,"div",25)(56,"div",26)(57,"h1",27),e.EFF(58,"DevProbe AI"),e.k0s()(),e.nrm(59,"div",28),e.j41(60,"div",29),e.bIt("click",function(){return e.eBV(n),e.Njj(t.toggleAiModal())}),e.nrm(61,"ion-icon",30),e.k0s()(),e.j41(62,"div",31,0),e.DNE(64,N,3,2,"div",32),e.k0s(),e.j41(65,"div",33)(66,"ion-textarea",34),e.mxI("ngModelChange",function(o){return e.eBV(n),e.DH7(t.message,o)||(t.message=o),e.Njj(o)}),e.k0s(),e.nrm(67,"div",35),e.j41(68,"div",36),e.bIt("click",function(){return e.eBV(n),e.Njj(t.sendMessage())}),e.j41(69,"span",27),e.EFF(70,"Send"),e.k0s()()()()()}2&s&&(e.Y8G("title","Load Test For "+t.productStep),e.R7$(),e.Y8G("fullscreen",!0),e.R7$(2),e.Y8G("title","New Load Test"),e.R7$(5),e.R50("ngModel",t.target),e.R7$(6),e.Y8G("title","Analytics For "+t.productStep),e.R7$(9),e.JRh(e.i5U(24,15,t.totalNumberOfRequests,"1.0-0")),e.R7$(12),e.Y8G("options",t.statusCodesOptions),e.R7$(11),e.Y8G("options",t.responseTimeOptions),e.R7$(),e.Y8G("title","Results for date: "),e.R7$(4),e.Y8G("ngForOf",t.listOfDates),e.R7$(),e.vxM(52,t.hasBeenOpened?52:-1),e.R7$(),e.AVh("hidden",!t.aiModal),e.R7$(11),e.Y8G("ngForOf",t.messages),e.R7$(2),e.R50("ngModel",t.message))},dependencies:[g.Sq,g.bT,j.BC,j.vS,d.mC,d.Jm,d.b_,d.I9,d.ME,d.tN,d.hU,d.W9,d.Q8,d.lO,d.iq,d.$w,d.uz,d.he,d.nf,d.ln,d.nc,d.Gw,O.W,M.p,P.$P,L.NN,g.QX]}),T})()}];let $=(()=>{var l;class T{}return(l=T).\u0275fac=function(s){return new(s||l)},l.\u0275mod=e.$C({type:l}),l.\u0275inj=e.G2t({imports:[b.iI.forChild(S),b.iI]}),T})();var G=u(5553);let B=(()=>{var l;class T{}return(l=T).\u0275fac=function(s){return new(s||l)},l.\u0275mod=e.$C({type:l}),l.\u0275inj=e.G2t({imports:[g.MD,j.YN,d.bv,$,G.h,L.NN]}),T})()}}]);
\ No newline at end of file
diff --git a/www/4559.893444f9e022cfc0.js b/www/4559.893444f9e022cfc0.js
deleted file mode 100644
index 98cd79d..0000000
--- a/www/4559.893444f9e022cfc0.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4559],{5553:(w,k,u)=>{u.d(k,{h:()=>_});var p=u(177),b=u(7863),d=u(4438);let _=(()=>{var m;class e{}return(m=e).\u0275fac=function(j){return new(j||m)},m.\u0275mod=d.$C({type:m}),m.\u0275inj=d.G2t({imports:[p.MD,b.bv]}),e})()},3241:(w,k,u)=>{u.d(k,{p:()=>_});var p=u(4438),b=u(177),d=u(7863);let _=(()=>{var m;class e{constructor(j){this.location=j,this.title="Header Title"}ngOnInit(){}goBack(){this.location.back()}}return(m=e).\u0275fac=function(j){return new(j||m)(p.rXU(b.aZ))},m.\u0275cmp=p.VBU({type:m,selectors:[["app-header-return"]],inputs:{title:"title"},decls:6,vars:2,consts:[[3,"translucent"],["slot","start","menu","menu-id"],["name","arrow-back","slot","start",1,"p-4","bigger-icon",3,"click"]],template:function(j,O){1&j&&(p.j41(0,"ion-header",0)(1,"ion-toolbar"),p.nrm(2,"ion-menu-button",1),p.j41(3,"ion-icon",2),p.bIt("click",function(){return O.goBack()}),p.k0s(),p.j41(4,"ion-title"),p.EFF(5),p.k0s()()()),2&j&&(p.Y8G("translucent",!0),p.R7$(5),p.JRh(O.title))},dependencies:[d.eU,d.iq,d.MC,d.BC,d.ai],styles:[".bigger-icon[_ngcontent-%COMP%]{font-size:1.5em}"]}),e})()},4559:(w,k,u)=>{u.r(k),u.d(k,{LoadTestPageModule:()=>G});var p=u(177),b=u(4341),d=u(7863),_=u(7650),m=u(467),e=u(4438),R=u(9032),j=u(4970),O=u(8453),M=u(3241),L=u(2820),P=u(9549);const E=["messagesContainer"];function A(l,T){if(1&l){const f=e.RV6();e.j41(0,"ion-item",39),e.bIt("click",function(){const t=e.eBV(f).$implicit,n=e.XpG();return e.Njj(n.viewHistory(t))}),e.j41(1,"ion-label"),e.EFF(2),e.k0s(),e.nrm(3,"ion-icon",40),e.k0s()}if(2&l){const f=T.$implicit;e.R7$(2),e.JRh(f)}}function F(l,T){if(1&l&&(e.j41(0,"div",44)(1,"markdown",45),e.EFF(2),e.k0s()()),2&l){const f=e.XpG().$implicit;e.R7$(2),e.JRh(f.message)}}function I(l,T){if(1&l&&(e.j41(0,"div",46)(1,"markdown",47),e.EFF(2),e.k0s()()),2&l){const f=e.XpG().$implicit;e.R7$(),e.Mz_("id","mk-",f.id,""),e.R7$(),e.JRh(f.message)}}function D(l,T){if(1&l&&(e.j41(0,"div",41),e.DNE(1,F,3,1,"div",42)(2,I,3,3,"div",43),e.k0s()),2&l){const f=T.$implicit;e.R7$(),e.Y8G("ngIf","User"===f.from),e.R7$(),e.Y8G("ngIf","AI"===f.from)}}const N=[{path:"",component:(()=>{var l;class T{constructor(s,t,n,i,o){this.router=s,this.activatedRoute=t,this.loadTestService=n,this.loadingCtrl=i,this.alertCtrl=o,this.productStep="",this.productObjective="",this.orgName="",this.target="",this.description="",this.loadTestResults={},this.totalNumberOfRequests=0,this.statusCodesOptions={tooltip:{trigger:"axis"},xAxis:{type:"category",boundaryGap:!1,data:[]},yAxis:{type:"value"},series:[]},this.responseTimeOptions={tooltip:{trigger:"axis"},xAxis:{type:"category",boundaryGap:!1,data:[]},yAxis:{type:"value"},series:[]},this.listOfDates=[],this.aiModal=!1,this.message="",this.vertexAI=(0,e.WQX)(R.L9),this.model=(0,R.oc)(this.vertexAI,{model:"gemini-1.5-flash"}),this.chat=this.model.startChat({history:[{role:"user",parts:[{text:"Hola, desde ahora en adelante quiero que seas un modelo experto en Software Quality Assurance y analista de datos, tu nombre es DevProbeAI, nunca lo puedes olvidar"}]},{role:"model",parts:[{text:"Soy un modelo experto en Software Quality Assurance, de igual forma tengo un masterado en anla\xedtica de datos \xbfEn qu\xe9 puedo ayudarte?"}]},{role:"user",parts:[{text:"Gracias, te voy a entregar un json con datos en unos minutos, necesito que lo analices y me des un resumen de los datos, este json contiene datos de un load test,tu analisis tiene que ser detallado, si encuentras inconsistencias en los datos, por favor mencionalas, en caso de que creas que puede haber un problema o que se encuentre el recurso no disponible por favor mencionalo, si encuentras algo interesante, por favor mencionalo, en resumen, necesito un analisis detallado de los datos"}]},{role:"model",parts:[{text:"Claro, env\xedame el json y yo me encargo de analizarlo"}]}]}),this.messages=[]}ngOnInit(){}ionViewWillEnter(){var s=this;return(0,m.A)(function*(){yield s.showLoading(),s.getParams(),yield s.getHistoryResults().then(()=>{s.plotCodes(),s.totalRequests(),s.responseTime()}),yield s.hideLoading()})()}getParams(){this.activatedRoute.params.subscribe(t=>{this.productObjective=t.productObjective,this.productStep=t.step});const s=JSON.parse(localStorage.getItem("user"));this.orgName=s.orgName,console.log(this.orgName),console.log(this.productObjective),console.log(this.productStep)}sendRequest(){var s=this;return(0,m.A)(function*(){if(yield s.showLoading(),s.target.startsWith("http://")||s.target.startsWith("https://")||s.target.endsWith("/"))return yield s.hideLoading(),void(yield s.showAlert("No http or https is needed, check for slashes at the end of the domain","Please enter a valid host"));yield s.loadTestService.sendLoadTest(s.orgName,s.productObjective,s.productStep,s.target).then(function(){var t=(0,m.A)(function*(n){yield s.hideLoading(),console.log("data",n),n&&(yield s.showAlert("Test sent, please wait a few seconds to GET RESULTS","Success"))});return function(n){return t.apply(this,arguments)}}()),yield s.hideLoading()})()}getHistoryResults(){var s=this;return(0,m.A)(function*(){s.loadTestResults=yield s.loadTestService.getLoadTestHistory(s.orgName,s.productObjective,s.productStep)})()}totalRequests(){let s=Object.keys(this.loadTestResults),t={},n=0;for(let i of s){let o=this.loadTestResults[i].aggregate.counters,v=this.loadTestResults[i].date,c=Object.keys(o).filter(y=>y.startsWith("http.requests"));for(let y of c)t[v]||(t[v]={}),t[v][y]=(t[v][y]||0)+o[y]}for(let i of Object.keys(t))n+=t[i]["http.requests"];this.totalNumberOfRequests=n}byCodes(){let s=Object.keys(this.loadTestResults),t={};for(let n of s){let i=this.loadTestResults[n].aggregate.counters,o=this.loadTestResults[n].date.split("-").slice(0,3).join("-"),v=Object.keys(i).filter(c=>c.startsWith("http.codes."));t[o]||(t[o]={});for(let c of v)t[o][c]=(t[o][c]||0)+i[c]}return t=this.ordenarDiccionarioPorFechas(t),console.log("codessss",t),t}normalizarFecha(s){const[t,n,i]=s.split("-").map(c=>parseInt(c,10));return`${t}-${n<10?`0${n}`:n.toString()}-${i<10?`0${i}`:i.toString()}`}ordenarDiccionarioPorFechas(s){const n=Object.keys(s).sort((o,v)=>{const c=new Date(this.normalizarFecha(o)),y=new Date(this.normalizarFecha(v));return c.getTime()-y.getTime()}),i={};return n.forEach(o=>{i[o]=s[o]}),i}plotCodes(){var s=this;return(0,m.A)(function*(){let t=s.byCodes();console.log(t);let n=Object.keys(t);s.listOfDates=n;let i=new Set;for(let y of n){let a=Object.keys(t[y]);for(let r of a)i.add(r)}let o={};for(let y in t){let g=t[y];for(let a of i)o[a]||(o[a]=[]),o[a].push(g[a]||0)}let v=["#36b311","#306fc6","#ed3b3b","#f4ba20"];for(let y in o){let a,g=y.split(".").pop();null!=g&&g.startsWith("2")&&(a=v[0]),null!=g&&g.startsWith("3")&&(a=v[1]),null!=g&&g.startsWith("4")&&(a=v[2]),null!=g&&g.startsWith("5")&&(a=v[3]),a||(a="#000000"),s.statusCodesOptions.series.push({name:y,type:"line",data:o[y],lineStyle:{color:a},itemStyle:{color:a}})}s.statusCodesOptions.xAxis={type:"category",boundaryGap:!1,data:n},s.statusCodesOptions={...s.statusCodesOptions};let c=document.getElementById("httpCodesChart");console.log(c),c.style.width="100%",c.style.height="25em"})()}responseTime(){let s=Object.keys(this.loadTestResults),t={};for(let a of s){let r=this.loadTestResults[a].aggregate.histograms,C=this.loadTestResults[a].date,h=Object.keys(r).filter(x=>x.startsWith("http.response_time"));for(let x of h)t[C]=r[x]}let n=Object.entries(t).reduce((a,[r,C])=>{const h=r.split("-").slice(0,3).join("-");return a[h]=a[h]||[],a[h].push(C),a},{}),i=Object.keys(n).sort((a,r)=>new Date(a).getTime()-new Date(r).getTime()),o={count:0,max:0,min:0,mean:0,median:0,p50:0,p90:0,p95:0,p99:0,p999:0},v={};i.forEach(a=>{let r={count:0,max:0,min:0,mean:0,median:0,p50:0,p90:0,p95:0,p99:0,p999:0},C=0;n[a].forEach(h=>{r.count+=h.count,r.max+=h.max,r.min+=h.min,r.mean+=h.mean,r.median+=h.median,r.p50+=h.p50,r.p90+=h.p90,r.p95+=h.p95,r.p99+=h.p99,r.p999+=h.p999,C++});for(let h in r)"count"!==h&&C>0&&(r[h]=r[h]/C);v[a]=r,o.count+=r.count,o.max+=r.max,o.min+=r.min,o.mean+=r.mean,o.median+=r.median,o.p50+=r.p50,o.p90+=r.p90,o.p95+=r.p95,o.p99+=r.p99,o.p999+=r.p999});let c=i.length;c>0&&(o.mean/=c,o.median/=c,o.p50/=c,o.p90/=c,o.p95/=c,o.p99/=c,o.p999/=c,o.max/=c,o.min/=c);let y={};for(let a in o)"count"===a||"p90"===a||"p50"===a||"p999"===a||(y[a]=o[a],this.responseTimeOptions.series.push({name:a,type:"bar",data:[o[a]],label:{show:!0,formatter:r=>`${r.value.toFixed(2)} ms`}}));this.responseTimeOptions.xAxis={type:"category",boundaryGap:!1,data:["Category"]},this.responseTimeOptions={...this.responseTimeOptions};let g=document.getElementById("httpResponseTimeChart");return console.log(g),g.style.width="100%",g.style.height="25em",y}showLoading(){var s=this;return(0,m.A)(function*(){yield(yield s.loadingCtrl.create({})).present()})()}hideLoading(){var s=this;return(0,m.A)(function*(){yield s.loadingCtrl.dismiss()})()}showAlert(s,t){var n=this;return(0,m.A)(function*(){const i=yield n.alertCtrl.create({header:t,message:s,buttons:["OK"]});return yield i.present(),yield i.onDidDismiss(),!0})()}viewHistory(s){this.router.navigate(["/load-test-history",{productObjective:this.productObjective,productStep:this.productStep,day:s}])}toggleAiModal(s){var t=this;return(0,m.A)(function*(){if(t.aiModal=!t.aiModal,"httpCodesOptions"===s&&(t.message="En este caso el json tiene codigos de respuesta HTTP, por ejemplo, 404, 500, etc y cuantos requests devolvieron esos codigos:"+JSON.stringify(t.byCodes())),"httpResponseTimeOptions"===s&&(t.message="En este caso el json tiene tiempos de respuesta de los requests, por ejemplo, 500ms, 1000ms, etc: "+JSON.stringify(t.responseTime())),""===t.message)return void console.log("Message is empty");let n=t.messages.length;n>0&&t.messages.push({message:t.message,from:"User",id:n.toString()});const i=yield t.chat.sendMessage(t.message);n=t.messages.length,t.messages.push({message:i.response.text(),from:"AI",id:n.toString()}),t.message=""})()}sendMessage(){let s=this.messages.length;this.messages.push({message:this.message,from:"User",id:s.toString()}),this.chat.sendMessage(this.message).then(t=>{s=this.messages.length,this.messages.push({message:t.response.text(),from:"AI",id:s.toString()})}),this.message=""}}return(l=T).\u0275fac=function(s){return new(s||l)(e.rXU(_.Ix),e.rXU(_.nX),e.rXU(j.s),e.rXU(d.Xi),e.rXU(d.hG))},l.\u0275cmp=e.VBU({type:l,selectors:[["app-load-test"]],viewQuery:function(s,t){if(1&s&&e.GBs(E,5),2&s){let n;e.mGM(n=e.lsd())&&(t.messagesContainer=n.first)}},decls:73,vars:17,consts:[["messagesContainer",""],[3,"title"],[3,"fullscreen"],[1,"lg:m-10","md:m-10"],["size","12"],["label","Target","placeholder","Enter a target","type","text","labelPlacement","stacked",1,"",3,"ngModelChange","ngModel"],["size","12","size-md","12","size-lg","12",1,"flex","flex-row","justify-end"],["color","primary","size","small",1,"",3,"click"],["name","add"],[1,"w-full","p-6","flex","flex-col","justify-center","items-center"],[1,"text-3xl"],[1,"text-2xl","text-white"],["size","12",1,"relative"],[1,"absolute","z-10","flex","justify-center","items-center","-right-5","-top-5",3,"click"],[1,"bg-purple-600","justify-center","items-center","flex"],["size","large","name","color-wand-outline"],[1,"h-[25em]","w-full"],["id","httpCodesChart","echarts","",1,"demo-chart","h-full","w-full",3,"options"],["id","httpResponseTimeChart","echarts","",1,"demo-chart","h-full","w-full",3,"options"],["size","12",1,"w-full"],[1,"w-full"],["class","w-full",3,"click",4,"ngFor","ngForOf"],["vertical","bottom","horizontal","end","slot","fixed",1,"m-2","z-10",3,"click"],[1,"bg-purple-300","p-4"],["name","chatbubble-outline",1,"w-full","h-full"],["id","ai-modal",1,"fixed","bottom-0","right-0","h-full","w-full","bg-black","bg-opacity-60","z-10","r"],[1,"h-full","md:h-3/4","lg:h-3/4","w-full","bg-gray-900","p-4","absolute","right-0","bottom-0","z-50","flex","flex-col","rounded-tl-2xl","rounded-tr-2xl"],[1,"w-full","bg-gray-500","flex","flex-row","justify-center","items-center","p-2","mb-2","rounded-3xl"],[1,"flex","flex-row","p-2","items-center","bg-gray-800","w-full","rounded-3xl","h-full"],[1,"text-white"],[1,"m-2"],[1,"flex","flex-row","justify-center","items-center","bg-gray-800","hover:bg-gray-600","w-1/6","h-full","rounded-3xl",3,"click"],["name","close-outline"],[1,"flex-grow","overflow-y-auto","bg-gray-400","p-2","rounded-3xl"],["class","flex flex-col",4,"ngFor","ngForOf"],[1,"flex","flex-row","mt-2","p-2"],["placeholder","Ask...",1,"flex-grow","bg-gray-700","rounded-2xl",3,"ngModelChange","ngModel"],[1,"m-1"],[1,"w-1/3","bg-gray-500","rounded-3xl","flex","flex-row","justify-center","items-center","hover:bg-gray-300",3,"click"],[1,"w-full",3,"click"],["name","arrow-forward","color","primary"],[1,"flex","flex-col"],["class","rounded-3xl bg-gray-800 w-2/3 m-1 ml-auto p-2",4,"ngIf"],["class","rounded-3xl bg-gray-500 w-2/3 m-1 p-2 pr-2",4,"ngIf"],[1,"rounded-3xl","bg-gray-800","w-2/3","m-1","ml-auto","p-2"],[1,"text-white","p-4","m-2"],[1,"rounded-3xl","bg-gray-500","w-2/3","m-1","p-2","pr-2"],[1,"text-white","p-4","m-2",3,"id"]],template:function(s,t){if(1&s){const n=e.RV6();e.nrm(0,"app-header-return",1),e.j41(1,"ion-content",2)(2,"ion-grid"),e.nrm(3,"app-title",1),e.j41(4,"ion-row",3)(5,"ion-col",4)(6,"ion-card")(7,"ion-card-content")(8,"ion-input",5),e.mxI("ngModelChange",function(o){return e.eBV(n),e.DH7(t.target,o)||(t.target=o),e.Njj(o)}),e.k0s()()()()(),e.j41(9,"ion-row",3)(10,"ion-col",6)(11,"ion-button",7),e.bIt("click",function(){return e.eBV(n),e.Njj(t.sendRequest())}),e.EFF(12,"Load Target "),e.nrm(13,"ion-icon",8),e.k0s()()(),e.nrm(14,"app-title",1),e.j41(15,"ion-row",3)(16,"ion-col",4)(17,"ion-card",9)(18,"ion-card-header")(19,"ion-card-title",10),e.EFF(20,"Total Number of Requests"),e.k0s()(),e.j41(21,"ion-card-content")(22,"h1",11),e.EFF(23),e.nI1(24,"number"),e.k0s()()()()(),e.j41(25,"ion-row",3)(26,"ion-col",12)(27,"div",13),e.bIt("click",function(){return e.eBV(n),e.Njj(t.toggleAiModal("httpCodesOptions"))}),e.j41(28,"ion-avatar",14),e.nrm(29,"ion-icon",15),e.k0s()(),e.j41(30,"ion-card",9)(31,"ion-card-header")(32,"ion-card-title",10),e.EFF(33,"HTTP Status Codes"),e.k0s()(),e.j41(34,"ion-card-content",16),e.nrm(35,"div",17),e.k0s()()()(),e.j41(36,"ion-row",3)(37,"ion-col",12)(38,"div",13),e.bIt("click",function(){return e.eBV(n),e.Njj(t.toggleAiModal("httpResponseTimeOptions"))}),e.j41(39,"ion-avatar",14),e.nrm(40,"ion-icon",15),e.k0s()(),e.j41(41,"ion-card",9)(42,"ion-card-header")(43,"ion-card-title",10),e.EFF(44,"HTTP Response Time"),e.k0s()(),e.j41(45,"ion-card-content",16),e.nrm(46,"div",18),e.k0s()()()(),e.nrm(47,"app-title",1),e.j41(48,"ion-row",3)(49,"ion-col",19)(50,"ion-list",20),e.DNE(51,A,4,1,"ion-item",21),e.k0s()()()(),e.j41(52,"ion-fab",22),e.bIt("click",function(){return e.eBV(n),e.Njj(t.toggleAiModal())}),e.j41(53,"ion-avatar",23),e.nrm(54,"ion-icon",24),e.k0s()()(),e.j41(55,"div",25)(56,"div",26)(57,"div",27)(58,"div",28)(59,"h1",29),e.EFF(60,"DevProbe AI"),e.k0s()(),e.nrm(61,"div",30),e.j41(62,"div",31),e.bIt("click",function(){return e.eBV(n),e.Njj(t.toggleAiModal())}),e.nrm(63,"ion-icon",32),e.k0s()(),e.j41(64,"div",33,0),e.DNE(66,D,3,2,"div",34),e.k0s(),e.j41(67,"div",35)(68,"ion-textarea",36),e.mxI("ngModelChange",function(o){return e.eBV(n),e.DH7(t.message,o)||(t.message=o),e.Njj(o)}),e.k0s(),e.nrm(69,"div",37),e.j41(70,"div",38),e.bIt("click",function(){return e.eBV(n),e.Njj(t.sendMessage())}),e.j41(71,"span",29),e.EFF(72,"Send"),e.k0s()()()()()}2&s&&(e.Y8G("title","Load Test For "+t.productStep),e.R7$(),e.Y8G("fullscreen",!0),e.R7$(2),e.Y8G("title","New Load Test"),e.R7$(5),e.R50("ngModel",t.target),e.R7$(6),e.Y8G("title","Analytics For "+t.productStep),e.R7$(9),e.JRh(e.i5U(24,14,t.totalNumberOfRequests,"1.0-0")),e.R7$(12),e.Y8G("options",t.statusCodesOptions),e.R7$(11),e.Y8G("options",t.responseTimeOptions),e.R7$(),e.Y8G("title","Results for date: "),e.R7$(4),e.Y8G("ngForOf",t.listOfDates),e.R7$(4),e.AVh("hidden",!t.aiModal),e.R7$(11),e.Y8G("ngForOf",t.messages),e.R7$(2),e.R50("ngModel",t.message))},dependencies:[p.Sq,p.bT,b.BC,b.vS,d.mC,d.Jm,d.b_,d.I9,d.ME,d.tN,d.hU,d.W9,d.Q8,d.lO,d.iq,d.$w,d.uz,d.he,d.nf,d.ln,d.nc,d.Gw,O.W,M.p,L.$P,P.NN,p.QX]}),T})()}];let S=(()=>{var l;class T{}return(l=T).\u0275fac=function(s){return new(s||l)},l.\u0275mod=e.$C({type:l}),l.\u0275inj=e.G2t({imports:[_.iI.forChild(N),_.iI]}),T})();var $=u(5553);let G=(()=>{var l;class T{}return(l=T).\u0275fac=function(s){return new(s||l)},l.\u0275mod=e.$C({type:l}),l.\u0275inj=e.G2t({imports:[p.MD,b.YN,d.bv,S,$.h,P.NN]}),T})()}}]);
\ No newline at end of file
diff --git a/www/index.html b/www/index.html
index 1c43cbc..07d7218 100644
--- a/www/index.html
+++ b/www/index.html
@@ -17,10 +17,10 @@
-
+
-
+