@@ -108,44 +108,23 @@ getGlobal().measurements = {
108108 getMeasurements,
109109} ;
110110
111- const MEASUREMENT_API = `https://col.ops.csb.dev/data/sandpack ` ;
111+ const MEASUREMENT_API = `https://30vlq6h5qc.execute-api.eu-west-1.amazonaws.com/prod/metrics ` ;
112112
113113export function persistMeasurements ( data : {
114114 sandboxId : string ;
115115 cacheUsed : boolean ;
116116 browser : string ;
117117 version : string ;
118118} ) {
119- const body = [
120- {
121- measurement : 'load_times' ,
122- tags : {
123- browser : data . browser ,
124- sandbox_id : data . sandboxId ,
125- cache_used : data . cacheUsed ,
126- version : data . version ,
127- } ,
128- fields : {
129- transpilation : measurements . transpilation ,
130- evaluation : measurements . evaluation ,
131- external_resources : measurements [ 'external-resources' ] ,
132- compilation : measurements . compilation ,
133- boot : measurements . boot ,
134- total : measurements . total ,
135- dependencies : measurements . dependencies ,
136- } ,
137- } ,
138- ] ;
139-
140119 if ( process . env . NODE_ENV === 'development' || process . env . STAGING ) {
141- // eslint-disable-next-line
142- console . log ( body ) ;
143120 return Promise . resolve ( ) ;
144121 }
145122
123+ const finalData = { ...data , ...measurements } ;
124+
146125 return fetch ( MEASUREMENT_API , {
147126 method : 'POST' ,
148- body : JSON . stringify ( body ) ,
127+ body : JSON . stringify ( finalData ) ,
149128 headers : {
150129 Accept : 'application/json' ,
151130 'Content-Type' : 'application/json' ,
0 commit comments