locust 2.24.1.dev23__py3-none-any.whl → 2.24.2.dev8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
locust/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.24.1.dev23'
16
- __version_tuple__ = version_tuple = (2, 24, 1, 'dev23')
15
+ __version__ = version = '2.24.2.dev8'
16
+ __version_tuple__ = version_tuple = (2, 24, 2, 'dev8')
locust/runners.py CHANGED
@@ -119,7 +119,7 @@ class Runner:
119
119
  self.target_user_classes_count: dict[str, int] = {}
120
120
  # target_user_count is set before the ramp-up/ramp-down occurs.
121
121
  self.target_user_count: int = 0
122
- self.custom_messages: dict[str, Callable] = {}
122
+ self.custom_messages: dict[str, tuple[Callable, bool]] = {}
123
123
 
124
124
  self._users_dispatcher: UsersDispatcher | None = None
125
125
 
@@ -420,7 +420,7 @@ class Runner:
420
420
  row["nodes"].add(node_id)
421
421
  self.exceptions[key] = row
422
422
 
423
- def register_message(self, msg_type: str, listener: Callable) -> None:
423
+ def register_message(self, msg_type: str, listener: Callable, concurrent=False) -> None:
424
424
  """
425
425
  Register a listener for a custom message from another node
426
426
 
@@ -429,7 +429,7 @@ class Runner:
429
429
  """
430
430
  if msg_type in self.custom_messages:
431
431
  raise Exception(f"Tried to register listener method for {msg_type}, but it already had a listener!")
432
- self.custom_messages[msg_type] = listener
432
+ self.custom_messages[msg_type] = (listener, concurrent)
433
433
 
434
434
 
435
435
  class LocalRunner(Runner):
@@ -568,7 +568,7 @@ class LocalRunner(Runner):
568
568
  """
569
569
  logger.debug("Running locally: sending %s message to self" % msg_type)
570
570
  if msg_type in self.custom_messages:
571
- listener = self.custom_messages[msg_type]
571
+ listener, concurrent = self.custom_messages[msg_type]
572
572
  msg = Message(msg_type, data, "local")
573
573
  listener(environment=self.environment, msg=msg)
574
574
  else:
@@ -1139,7 +1139,11 @@ class MasterRunner(DistributedRunner):
1139
1139
  f"Received {msg.type} message from worker {msg.node_id} (index {self.get_worker_index(msg.node_id)})"
1140
1140
  )
1141
1141
  try:
1142
- self.custom_messages[msg.type](environment=self.environment, msg=msg)
1142
+ listener, concurrent = self.custom_messages[msg.type]
1143
+ if not concurrent:
1144
+ listener(environment=self.environment, msg=msg)
1145
+ else:
1146
+ gevent.spawn(listener, self.environment, msg)
1143
1147
  except Exception:
1144
1148
  logging.error(f"Uncaught exception in handler for {msg.type}\n{traceback.format_exc()}")
1145
1149
 
@@ -1393,7 +1397,11 @@ class WorkerRunner(DistributedRunner):
1393
1397
  self.last_heartbeat_timestamp = time.time()
1394
1398
  elif msg.type in self.custom_messages:
1395
1399
  logger.debug("Received %s message from master" % msg.type)
1396
- self.custom_messages[msg.type](environment=self.environment, msg=msg)
1400
+ listener, concurrent = self.custom_messages[msg.type]
1401
+ if not concurrent:
1402
+ listener(environment=self.environment, msg=msg)
1403
+ else:
1404
+ gevent.spawn(listener, self.environment, msg)
1397
1405
  else:
1398
1406
  logger.warning(f"Unknown message type received: {msg.type}")
1399
1407
 
@@ -606,6 +606,31 @@ class TestLocustRunner(LocustRunnerTestCase):
606
606
  self.assertTrue(test_custom_msg[0])
607
607
  self.assertEqual(123, test_custom_msg_data[0]["test_data"])
608
608
 
609
+ def test_concurrent_custom_message(self):
610
+ class MyUser(User):
611
+ wait_time = constant(1)
612
+
613
+ @task
614
+ def my_task(self):
615
+ pass
616
+
617
+ test_custom_msg = [False]
618
+ test_custom_msg_data = [{}]
619
+
620
+ def on_custom_msg(msg, **kw):
621
+ test_custom_msg[0] = True
622
+ test_custom_msg_data[0] = msg.data
623
+
624
+ environment = Environment(user_classes=[MyUser])
625
+ runner = LocalRunner(environment)
626
+
627
+ runner.register_message("test_custom_msg", on_custom_msg, concurrent=True)
628
+ runner.send_message("test_custom_msg", {"test_data": 123})
629
+
630
+ gevent.sleep(0.5)
631
+ self.assertTrue(test_custom_msg[0])
632
+ self.assertEqual(123, test_custom_msg_data[0]["test_data"])
633
+
609
634
  def test_undefined_custom_message(self):
610
635
  class MyUser(User):
611
636
  wait_time = constant(1)
@@ -168,7 +168,7 @@ ${W.current.stack}
168
168
  `});++n<e.length;)n&&r.push({type:"text",value:`
169
169
  `}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
170
170
  `}),r}function tE(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function rE(e,t){const r=ive(e,t),n=r.one(e,void 0),i=qpe(r),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
171
- `},i),a}function uve(e,t){return e&&"run"in e?async function(r,n){const i=rE(r,t);await e.run(i,n)}:function(r){return rE(r,t||e)}}function nE(e){if(e)throw e}var Ym=Object.prototype.hasOwnProperty,F6=Object.prototype.toString,iE=Object.defineProperty,aE=Object.getOwnPropertyDescriptor,oE=function(t){return typeof Array.isArray=="function"?Array.isArray(t):F6.call(t)==="[object Array]"},sE=function(t){if(!t||F6.call(t)!=="[object Object]")return!1;var r=Ym.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&Ym.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||Ym.call(t,i)},lE=function(t,r){iE&&r.name==="__proto__"?iE(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},uE=function(t,r){if(r==="__proto__")if(Ym.call(t,r)){if(aE)return aE(t,r).value}else return;return t[r]},cve=function e(){var t,r,n,i,a,o,s=arguments[0],l=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<u;++l)if(t=arguments[l],t!=null)for(r in t)n=uE(s,r),i=uE(t,r),s!==i&&(c&&i&&(sE(i)||(a=oE(i)))?(a?(a=!1,o=n&&oE(n)?n:[]):o=n&&sE(n)?n:{},lE(s,{name:r,newValue:e(c,o,i)})):typeof i<"u"&&lE(s,{name:r,newValue:i}));return s};const lb=dv(cve);function oT(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function fve(){const e=[],t={run:r,use:n};return t;function r(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);s(null,...i);function s(l,...u){const c=e[++a];let f=-1;if(l){o(l);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?dve(c,s)(...u):o(null,...u)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function dve(e,t){let r;return n;function n(...o){const s=e.length>o.length;let l;s&&o.push(i);try{l=e.apply(this,o)}catch(u){const c=u;if(s&&r)throw c;return i(c)}s||(l instanceof Promise?l.then(a,i):l instanceof Error?i(l):a(l))}function i(o,...s){r||(r=!0,t(o,...s))}function a(o){i(null,o)}}const da={basename:hve,dirname:pve,extname:vve,join:gve,sep:"/"};function hve(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mv(e);let r=0,n=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(n=i):(s=-1,n=o));return r===n?n=o:n<0&&(n=e.length),e.slice(r,n)}function pve(e){if(Mv(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function vve(e){Mv(e);let t=e.length,r=-1,n=0,i=-1,a=0,o;for(;t--;){const s=e.codePointAt(t);if(s===47){if(o){n=t+1;break}continue}r<0&&(o=!0,r=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function gve(...e){let t=-1,r;for(;++t<e.length;)Mv(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":mve(r)}function mve(e){Mv(e);const t=e.codePointAt(0)===47;let r=yve(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function yve(e,t){let r="",n=0,i=-1,a=0,o=-1,s,l;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=o,a=0;continue}}else if(r.length>0){r="",n=0,i=o,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,o):r=e.slice(i+1,o),n=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return r}function Mv(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xve={cwd:Sve};function Sve(){return"/"}function sT(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bve(e){if(typeof e=="string")e=new URL(e);else if(!sT(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return _ve(e)}function _ve(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ub=["history","path","basename","stem","extname","dirname"];class V6{constructor(t){let r;t?sT(t)?r={path:t}:typeof t=="string"||wve(t)?r={value:t}:r=t:r={},this.cwd=xve.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<ub.length;){const a=ub[n];a in r&&r[a]!==void 0&&r[a]!==null&&(this[a]=a==="history"?[...r[a]]:r[a])}let i;for(i in r)ub.includes(i)||(this[i]=r[i])}get basename(){return typeof this.path=="string"?da.basename(this.path):void 0}set basename(t){fb(t,"basename"),cb(t,"basename"),this.path=da.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?da.dirname(this.path):void 0}set dirname(t){cE(this.basename,"dirname"),this.path=da.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?da.extname(this.path):void 0}set extname(t){if(cb(t,"extname"),cE(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=da.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sT(t)&&(t=bve(t)),fb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?da.basename(this.path,this.extname):void 0}set stem(t){fb(t,"stem"),cb(t,"stem"),this.path=da.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){const i=this.message(t,r,n);throw i.fatal=!0,i}info(t,r,n){const i=this.message(t,r,n);return i.fatal=void 0,i}message(t,r,n){const i=new pn(t,r,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function cb(e,t){if(e&&e.includes(da.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+da.sep+"`")}function fb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function wve(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Cve=function(e){const n=this.constructor.prototype,i=n[e],a=function(){return i.apply(a,arguments)};Object.setPrototypeOf(a,n);const o=Object.getOwnPropertyNames(i);for(const s of o){const l=Object.getOwnPropertyDescriptor(i,s);l&&Object.defineProperty(a,s,l)}return a},Tve={}.hasOwnProperty;class sk extends Cve{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=fve()}copy(){const t=new sk;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(lb(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(pb("data",this.frozen),this.namespace[t]=r,this):Tve.call(this.namespace,t)&&this.namespace[t]||void 0:t?(pb("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=r.call(t,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Ag(t),n=this.parser||this.Parser;return db("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),db("process",this.parser||this.Parser),hb("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(a,o){const s=Ag(t),l=n.parse(s);n.run(l,s,function(c,f,d){if(c||!f||!d)return u(c);const h=f,p=n.stringify(h,d);kve(p)?d.value=p:d.result=p,u(c,d)});function u(c,f){c||!f?o(c):a?a(f):r(void 0,f)}}}processSync(t){let r=!1,n;return this.freeze(),db("processSync",this.parser||this.Parser),hb("processSync",this.compiler||this.Compiler),this.process(t,i),dE("processSync","process",r),n;function i(a,o){r=!0,nE(a),n=o}}run(t,r,n){fE(t),this.freeze();const i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?a(void 0,n):new Promise(a);function a(o,s){const l=Ag(r);i.run(t,l,u);function u(c,f,d){const h=f||t;c?s(c):o?o(h):n(void 0,h,d)}}}runSync(t,r){let n=!1,i;return this.run(t,r,a),dE("runSync","run",n),i;function a(o,s){nE(o),i=s,n=!0}}stringify(t,r){this.freeze();const n=Ag(r),i=this.compiler||this.Compiler;return hb("stringify",i),fE(t),i(t,n)}use(t,...r){const n=this.attachers,i=this.namespace;if(pb("use",this.frozen),t!=null)if(typeof t=="function")l(t,r);else if(typeof t=="object")Array.isArray(t)?s(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;l(c,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(u.plugins),u.settings&&(i.settings=lb(!0,i.settings,u.settings))}function s(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];a(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,d=-1;for(;++f<n.length;)if(n[f][0]===u){d=f;break}if(d===-1)n.push([u,...c]);else if(c.length>0){let[h,...p]=c;const v=n[d][1];oT(v)&&oT(h)&&(h=lb(!0,v,h)),n[d]=[u,h,...p]}}}}const Ave=new sk().freeze();function db(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pb(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fE(e){if(!oT(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dE(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ag(e){return Mve(e)?e:new V6(e)}function Mve(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function kve(e){return typeof e=="string"||Ive(e)}function Ive(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hE={}.hasOwnProperty,Pve="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",pE=[],vE={allowDangerousHtml:!0},Dve=/^(https?|ircs?|mailto|xmpp)$/i,Rve=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Lve(e){const t=e.allowedElements,r=e.allowElement,n=e.children||"",i=e.className,a=e.components,o=e.disallowedElements,s=e.rehypePlugins||pE,l=e.remarkPlugins||pE,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vE}:vE,c=e.skipHtml,f=e.unwrapDisallowed,d=e.urlTransform||Eve,h=Ave().use(ppe).use(l).use(uve,u).use(s),p=new V6;typeof n=="string"&&(p.value=n);for(const y of Rve)Object.hasOwn(e,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+Pve+y.id,void 0);const v=h.parse(p);let g=h.runSync(v,p);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),$6(g,m),Zfe(g,{Fragment:D.Fragment,components:a,ignoreInvalidStyle:!0,jsx:D.jsx,jsxs:D.jsxs,passKeys:!0,passNode:!0});function m(y,x,S){if(y.type==="raw"&&S&&typeof x=="number")return c?S.children.splice(x,1):S.children[x]={type:"text",value:y.value},x;if(y.type==="element"){let _;for(_ in ab)if(hE.call(ab,_)&&hE.call(y.properties,_)){const b=y.properties[_],w=ab[_];(w===null||w.includes(y.tagName))&&(y.properties[_]=d(String(b||""),_,y))}}if(y.type==="element"){let _=t?!t.includes(y.tagName):o?o.includes(y.tagName):!1;if(!_&&r&&typeof x=="number"&&(_=!r(y,x,S)),_&&S&&typeof x=="number")return f&&y.children?S.children.splice(x,1,...y.children):S.children.splice(x,1),x}}}function Eve(e){return pde(e,Dve)}function Ove(e,t){const r=t?-1:1;return function(n,i){const a=n[e],o=i[e];return a<o?r*-1:a>o?r*1:0}}function Nve(e,{hasTotalRow:t=!1,defaultSortKey:r="name"}={hasTotalRow:!1,defaultSortKey:"name"}){const[n,i]=O.useState(e),[a,o]=O.useState(!1),s=O.useRef(),l=c=>{const d=(t?e.slice(0,-1):[...e]).sort(Ove(c,c===s.current&&!a));i(t?[...d,...e.slice(-1)]:d)},u=O.useCallback(c=>{s.current||(s.current=r);const f=c.target.getAttribute("data-sortkey");if(f===s.current)if(a){o(!1),s.current=void 0,l(r);return}else o(!0);else a&&o(!1);l(f),s.current=f},[s,e,a]);return O.useEffect(()=>{e.length&&l(s.current||r)},[e]),{onTableHeadClick:u,sortedRows:n,currentSortField:s.current}}const dh=(e,t=0)=>{const r=Math.pow(10,t);return Math.round(e*r)/r};function zve({content:e,formatter:t,round:r,markdown:n}){return t?t(e):r?dh(e,r):n?D.jsx(Lve,{skipHtml:!1,children:e}):e}function qf({rows:e,structure:t,hasTotalRow:r,defaultSortKey:n}){const{onTableHeadClick:i,sortedRows:a,currentSortField:o}=Nve(e,{hasTotalRow:r,defaultSortKey:n});return D.jsx(RG,{component:Wf,children:D.jsxs(PG,{children:[D.jsx(LG,{children:D.jsx(Qy,{children:t.map(({title:s,key:l})=>D.jsx(zl,{"data-sortkey":l,onClick:i,sx:{cursor:"pointer",color:o===l?"primary.main":"text.primary"},children:s},`table-head-${l}`))})}),D.jsx(DG,{children:a.map((s,l)=>D.jsx(Qy,{children:t.map(({key:u,...c},f)=>D.jsx(zl,{children:D.jsx(zve,{content:s[u],...c})},`table-row=${f}`))},`${s.name}-${l}`))})]})})}function Bve({rows:e,tableStructure:t}){return t?D.jsx(qf,{rows:e,structure:t}):null}const $ve=({swarm:{extendedTables:e},ui:{extendedStats:t},url:{query:r}})=>{const n=r&&r.tab&&e&&e.find(({key:a})=>a===r.tab),i=r&&r.tab&&t&&t.find(({key:a})=>a===r.tab);return{tableStructure:n?n.structure.map(({key:a,...o})=>({key:vV(a),...o})):null,rows:i?i.data:[]}},Fve=Ln($ve)(Bve),Vve=[{key:"count",title:"# occurrences"},{key:"msg",title:"Message"},{key:"traceback",title:"Traceback"}];function G6({exceptions:e}){return D.jsx(qf,{rows:e,structure:Vve})}const Gve=({ui:{exceptions:e}})=>({exceptions:e}),Hve=Ln(Gve)(G6),Wve=[{key:"occurrences",title:"# Failures"},{key:"method",title:"Method"},{key:"name",title:"Name"},{key:"error",title:"Message",markdown:!0}];function H6({errors:e}){return D.jsx(qf,{rows:e,structure:Wve})}const jve=({ui:{errors:e}})=>({errors:e}),Uve=Ln(jve)(H6);function qve(){const e=Ys(({logViewer:{logs:t}})=>t);return D.jsxs(it,{children:[D.jsx(qe,{component:"h2",variant:"h4",children:"Logs"}),D.jsx("ul",{children:e.map((t,r)=>D.jsx("li",{children:t},`log-${r}`))})]})}function Yve({extendedCsvFiles:e,statsHistoryEnabled:t}){const r=Ys(({theme:{isDarkMode:n}})=>n);return D.jsxs(yG,{sx:{display:"flex",flexDirection:"column"},children:[D.jsx(tc,{children:D.jsx(on,{href:"/stats/requests/csv",children:"Download requests CSV"})}),t&&D.jsx(tc,{children:D.jsx(on,{href:"/stats/requests_full_history/csv",children:"Download full request statistics history CSV"})}),D.jsx(tc,{children:D.jsx(on,{href:"/stats/failures/csv",children:"Download failures CSV"})}),D.jsx(tc,{children:D.jsx(on,{href:"/exceptions/csv",children:"Download exceptions CSV"})}),D.jsx(tc,{children:D.jsx(on,{href:`/stats/report?theme=${r?Si.DARK:Si.LIGHT}`,target:"_blank",children:"Download Report"})}),e&&e.map(({href:n,title:i},a)=>D.jsx(tc,{children:D.jsx(on,{href:n,children:i})},`extended-csv-${a}`))]})}const Xve=({swarm:{extendedCsvFiles:e,statsHistoryEnabled:t}})=>({extendedCsvFiles:e,statsHistoryEnabled:t}),Zve=Ln(Xve)(Yve);var lk={},Kve=Ou;Object.defineProperty(lk,"__esModule",{value:!0});var W6=lk.default=void 0,Qve=Kve(Nu()),Jve=D,ege=(0,Qve.default)((0,Jve.jsx)("path",{d:"M14.67 5v14H9.33V5h5.34zm1 14H21V5h-5.33v14zm-7.34 0V5H3v14h5.33z"}),"ViewColumn");W6=lk.default=ege;function tge({structure:e,selectedColumns:t,addColumn:r,removeColumn:n}){const[i,a]=O.useState(null);return D.jsxs(fG,{direction:"row",justifyContent:"end",my:2,spacing:1,children:[D.jsx(qa,{onClick:o=>a(o.currentTarget),variant:"outlined",children:D.jsx(W6,{})}),D.jsx(_G,{anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},onClose:()=>a(null),open:!!i,children:D.jsx(hG,{sx:{p:2},children:e.map(({key:o,title:s})=>D.jsx(dG,{control:D.jsx(Ise,{checked:t.includes(o),onChange:()=>{t.includes(o)?n(o):r(o)}}),label:s},o))})})]})}function rge(e){const[t,r]=O.useState(e.map(o=>o.key));return{selectedColumns:t,addColumn:o=>{r([...t,o])},removeColumn:o=>{r(t.filter(s=>s!==o))},filteredStructure:(o=>o.filter(s=>t.includes(s.key)))(e)}}const nge=Ra.percentilesToStatistics?Ra.percentilesToStatistics.map(e=>({title:`${e*100}%ile (ms)`,key:`responseTimePercentile${e}`})):[],gE=[{key:"method",title:"Type"},{key:"name",title:"Name"},{key:"numRequests",title:"# Requests"},{key:"numFailures",title:"# Fails"},{key:"medianResponseTime",title:"Median (ms)",round:2},...nge,{key:"avgResponseTime",title:"Average (ms)",round:2},{key:"minResponseTime",title:"Min (ms)"},{key:"maxResponseTime",title:"Max (ms)"},{key:"avgContentLength",title:"Average size (bytes)",round:2},{key:"currentRps",title:"Current RPS",round:2},{key:"currentFailPerSec",title:"Current Failures/s",round:2}];function j6({stats:e}){const{selectedColumns:t,addColumn:r,removeColumn:n,filteredStructure:i}=rge(gE);return D.jsxs(D.Fragment,{children:[D.jsx(tge,{addColumn:r,removeColumn:n,selectedColumns:t,structure:gE}),D.jsx(qf,{hasTotalRow:!0,rows:e,structure:i})]})}const ige=({ui:{stats:e}})=>({stats:e}),age=Ln(ige)(j6);/*! *****************************************************************************
171
+ `},i),a}function uve(e,t){return e&&"run"in e?async function(r,n){const i=rE(r,t);await e.run(i,n)}:function(r){return rE(r,t||e)}}function nE(e){if(e)throw e}var Ym=Object.prototype.hasOwnProperty,F6=Object.prototype.toString,iE=Object.defineProperty,aE=Object.getOwnPropertyDescriptor,oE=function(t){return typeof Array.isArray=="function"?Array.isArray(t):F6.call(t)==="[object Array]"},sE=function(t){if(!t||F6.call(t)!=="[object Object]")return!1;var r=Ym.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&Ym.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||Ym.call(t,i)},lE=function(t,r){iE&&r.name==="__proto__"?iE(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},uE=function(t,r){if(r==="__proto__")if(Ym.call(t,r)){if(aE)return aE(t,r).value}else return;return t[r]},cve=function e(){var t,r,n,i,a,o,s=arguments[0],l=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<u;++l)if(t=arguments[l],t!=null)for(r in t)n=uE(s,r),i=uE(t,r),s!==i&&(c&&i&&(sE(i)||(a=oE(i)))?(a?(a=!1,o=n&&oE(n)?n:[]):o=n&&sE(n)?n:{},lE(s,{name:r,newValue:e(c,o,i)})):typeof i<"u"&&lE(s,{name:r,newValue:i}));return s};const lb=dv(cve);function oT(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function fve(){const e=[],t={run:r,use:n};return t;function r(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);s(null,...i);function s(l,...u){const c=e[++a];let f=-1;if(l){o(l);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?dve(c,s)(...u):o(null,...u)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function dve(e,t){let r;return n;function n(...o){const s=e.length>o.length;let l;s&&o.push(i);try{l=e.apply(this,o)}catch(u){const c=u;if(s&&r)throw c;return i(c)}s||(l instanceof Promise?l.then(a,i):l instanceof Error?i(l):a(l))}function i(o,...s){r||(r=!0,t(o,...s))}function a(o){i(null,o)}}const da={basename:hve,dirname:pve,extname:vve,join:gve,sep:"/"};function hve(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mv(e);let r=0,n=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(n=i):(s=-1,n=o));return r===n?n=o:n<0&&(n=e.length),e.slice(r,n)}function pve(e){if(Mv(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function vve(e){Mv(e);let t=e.length,r=-1,n=0,i=-1,a=0,o;for(;t--;){const s=e.codePointAt(t);if(s===47){if(o){n=t+1;break}continue}r<0&&(o=!0,r=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function gve(...e){let t=-1,r;for(;++t<e.length;)Mv(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":mve(r)}function mve(e){Mv(e);const t=e.codePointAt(0)===47;let r=yve(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function yve(e,t){let r="",n=0,i=-1,a=0,o=-1,s,l;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=o,a=0;continue}}else if(r.length>0){r="",n=0,i=o,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,o):r=e.slice(i+1,o),n=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return r}function Mv(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xve={cwd:Sve};function Sve(){return"/"}function sT(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bve(e){if(typeof e=="string")e=new URL(e);else if(!sT(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return _ve(e)}function _ve(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ub=["history","path","basename","stem","extname","dirname"];class V6{constructor(t){let r;t?sT(t)?r={path:t}:typeof t=="string"||wve(t)?r={value:t}:r=t:r={},this.cwd=xve.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<ub.length;){const a=ub[n];a in r&&r[a]!==void 0&&r[a]!==null&&(this[a]=a==="history"?[...r[a]]:r[a])}let i;for(i in r)ub.includes(i)||(this[i]=r[i])}get basename(){return typeof this.path=="string"?da.basename(this.path):void 0}set basename(t){fb(t,"basename"),cb(t,"basename"),this.path=da.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?da.dirname(this.path):void 0}set dirname(t){cE(this.basename,"dirname"),this.path=da.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?da.extname(this.path):void 0}set extname(t){if(cb(t,"extname"),cE(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=da.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sT(t)&&(t=bve(t)),fb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?da.basename(this.path,this.extname):void 0}set stem(t){fb(t,"stem"),cb(t,"stem"),this.path=da.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){const i=this.message(t,r,n);throw i.fatal=!0,i}info(t,r,n){const i=this.message(t,r,n);return i.fatal=void 0,i}message(t,r,n){const i=new pn(t,r,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function cb(e,t){if(e&&e.includes(da.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+da.sep+"`")}function fb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function wve(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Cve=function(e){const n=this.constructor.prototype,i=n[e],a=function(){return i.apply(a,arguments)};Object.setPrototypeOf(a,n);const o=Object.getOwnPropertyNames(i);for(const s of o){const l=Object.getOwnPropertyDescriptor(i,s);l&&Object.defineProperty(a,s,l)}return a},Tve={}.hasOwnProperty;class sk extends Cve{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=fve()}copy(){const t=new sk;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(lb(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(pb("data",this.frozen),this.namespace[t]=r,this):Tve.call(this.namespace,t)&&this.namespace[t]||void 0:t?(pb("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=r.call(t,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Ag(t),n=this.parser||this.Parser;return db("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),db("process",this.parser||this.Parser),hb("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(a,o){const s=Ag(t),l=n.parse(s);n.run(l,s,function(c,f,d){if(c||!f||!d)return u(c);const h=f,p=n.stringify(h,d);kve(p)?d.value=p:d.result=p,u(c,d)});function u(c,f){c||!f?o(c):a?a(f):r(void 0,f)}}}processSync(t){let r=!1,n;return this.freeze(),db("processSync",this.parser||this.Parser),hb("processSync",this.compiler||this.Compiler),this.process(t,i),dE("processSync","process",r),n;function i(a,o){r=!0,nE(a),n=o}}run(t,r,n){fE(t),this.freeze();const i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?a(void 0,n):new Promise(a);function a(o,s){const l=Ag(r);i.run(t,l,u);function u(c,f,d){const h=f||t;c?s(c):o?o(h):n(void 0,h,d)}}}runSync(t,r){let n=!1,i;return this.run(t,r,a),dE("runSync","run",n),i;function a(o,s){nE(o),i=s,n=!0}}stringify(t,r){this.freeze();const n=Ag(r),i=this.compiler||this.Compiler;return hb("stringify",i),fE(t),i(t,n)}use(t,...r){const n=this.attachers,i=this.namespace;if(pb("use",this.frozen),t!=null)if(typeof t=="function")l(t,r);else if(typeof t=="object")Array.isArray(t)?s(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;l(c,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(u.plugins),u.settings&&(i.settings=lb(!0,i.settings,u.settings))}function s(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];a(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,d=-1;for(;++f<n.length;)if(n[f][0]===u){d=f;break}if(d===-1)n.push([u,...c]);else if(c.length>0){let[h,...p]=c;const v=n[d][1];oT(v)&&oT(h)&&(h=lb(!0,v,h)),n[d]=[u,h,...p]}}}}const Ave=new sk().freeze();function db(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pb(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fE(e){if(!oT(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dE(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ag(e){return Mve(e)?e:new V6(e)}function Mve(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function kve(e){return typeof e=="string"||Ive(e)}function Ive(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hE={}.hasOwnProperty,Pve="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",pE=[],vE={allowDangerousHtml:!0},Dve=/^(https?|ircs?|mailto|xmpp)$/i,Rve=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Lve(e){const t=e.allowedElements,r=e.allowElement,n=e.children||"",i=e.className,a=e.components,o=e.disallowedElements,s=e.rehypePlugins||pE,l=e.remarkPlugins||pE,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vE}:vE,c=e.skipHtml,f=e.unwrapDisallowed,d=e.urlTransform||Eve,h=Ave().use(ppe).use(l).use(uve,u).use(s),p=new V6;typeof n=="string"&&(p.value=n);for(const y of Rve)Object.hasOwn(e,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+Pve+y.id,void 0);const v=h.parse(p);let g=h.runSync(v,p);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),$6(g,m),Zfe(g,{Fragment:D.Fragment,components:a,ignoreInvalidStyle:!0,jsx:D.jsx,jsxs:D.jsxs,passKeys:!0,passNode:!0});function m(y,x,S){if(y.type==="raw"&&S&&typeof x=="number")return c?S.children.splice(x,1):S.children[x]={type:"text",value:y.value},x;if(y.type==="element"){let _;for(_ in ab)if(hE.call(ab,_)&&hE.call(y.properties,_)){const b=y.properties[_],w=ab[_];(w===null||w.includes(y.tagName))&&(y.properties[_]=d(String(b||""),_,y))}}if(y.type==="element"){let _=t?!t.includes(y.tagName):o?o.includes(y.tagName):!1;if(!_&&r&&typeof x=="number"&&(_=!r(y,x,S)),_&&S&&typeof x=="number")return f&&y.children?S.children.splice(x,1,...y.children):S.children.splice(x,1),x}}}function Eve(e){return pde(e,Dve)}function Ove(e,t){const r=t?-1:1;return function(n,i){const a=n[e],o=i[e];return a<o?r*-1:a>o?r*1:0}}function Nve(e,{hasTotalRow:t=!1,defaultSortKey:r="name"}={hasTotalRow:!1,defaultSortKey:"name"}){const[n,i]=O.useState(e),[a,o]=O.useState(!1),s=O.useRef(),l=c=>{const d=(t?e.slice(0,-1):[...e]).sort(Ove(c,c===s.current&&!a));i(t?[...d,...e.slice(-1)]:d)},u=O.useCallback(c=>{s.current||(s.current=r);const f=c.target.getAttribute("data-sortkey");if(f===s.current)if(a){o(!1),s.current=void 0,l(r);return}else o(!0);else a&&o(!1);l(f),s.current=f},[s,e,a]);return O.useEffect(()=>{e.length&&l(s.current||r)},[e]),{onTableHeadClick:u,sortedRows:n,currentSortField:s.current}}const dh=(e,t=0)=>{const r=Math.pow(10,t);return Math.round(e*r)/r};function zve({content:e,formatter:t,round:r,markdown:n}){return t?t(e):r?dh(e,r):n?D.jsx(Lve,{skipHtml:!1,children:e}):e}function qf({rows:e,structure:t,hasTotalRow:r,defaultSortKey:n}){const{onTableHeadClick:i,sortedRows:a,currentSortField:o}=Nve(e,{hasTotalRow:r,defaultSortKey:n});return D.jsx(RG,{component:Wf,children:D.jsxs(PG,{children:[D.jsx(LG,{children:D.jsx(Qy,{children:t.map(({title:s,key:l})=>D.jsx(zl,{"data-sortkey":l,onClick:i,sx:{cursor:"pointer",color:o===l?"primary.main":"text.primary"},children:s},`table-head-${l}`))})}),D.jsx(DG,{children:a.map((s,l)=>D.jsx(Qy,{children:t.map(({key:u,...c},f)=>D.jsx(zl,{children:D.jsx(zve,{content:s[u],...c})},`table-row=${f}`))},`${s.name}-${l}`))})]})})}function Bve({rows:e,tableStructure:t}){return t?D.jsx(qf,{rows:e,structure:t}):null}const $ve=({swarm:{extendedTables:e},ui:{extendedStats:t},url:{query:r}})=>{const n=r&&r.tab&&e&&e.find(({key:a})=>a===r.tab),i=r&&r.tab&&t&&t.find(({key:a})=>a===r.tab);return{tableStructure:n?n.structure.map(({key:a,...o})=>({key:vV(a),...o})):null,rows:i?i.data:[]}},Fve=Ln($ve)(Bve),Vve=[{key:"count",title:"# occurrences"},{key:"msg",title:"Message",markdown:!0},{key:"traceback",title:"Traceback",markdown:!0}];function G6({exceptions:e}){return D.jsx(qf,{rows:e,structure:Vve})}const Gve=({ui:{exceptions:e}})=>({exceptions:e}),Hve=Ln(Gve)(G6),Wve=[{key:"occurrences",title:"# Failures"},{key:"method",title:"Method"},{key:"name",title:"Name"},{key:"error",title:"Message",markdown:!0}];function H6({errors:e}){return D.jsx(qf,{rows:e,structure:Wve})}const jve=({ui:{errors:e}})=>({errors:e}),Uve=Ln(jve)(H6);function qve(){const e=Ys(({logViewer:{logs:t}})=>t);return D.jsxs(it,{children:[D.jsx(qe,{component:"h2",variant:"h4",children:"Logs"}),D.jsx("ul",{children:e.map((t,r)=>D.jsx("li",{children:t},`log-${r}`))})]})}function Yve({extendedCsvFiles:e,statsHistoryEnabled:t}){const r=Ys(({theme:{isDarkMode:n}})=>n);return D.jsxs(yG,{sx:{display:"flex",flexDirection:"column"},children:[D.jsx(tc,{children:D.jsx(on,{href:"/stats/requests/csv",children:"Download requests CSV"})}),t&&D.jsx(tc,{children:D.jsx(on,{href:"/stats/requests_full_history/csv",children:"Download full request statistics history CSV"})}),D.jsx(tc,{children:D.jsx(on,{href:"/stats/failures/csv",children:"Download failures CSV"})}),D.jsx(tc,{children:D.jsx(on,{href:"/exceptions/csv",children:"Download exceptions CSV"})}),D.jsx(tc,{children:D.jsx(on,{href:`/stats/report?theme=${r?Si.DARK:Si.LIGHT}`,target:"_blank",children:"Download Report"})}),e&&e.map(({href:n,title:i},a)=>D.jsx(tc,{children:D.jsx(on,{href:n,children:i})},`extended-csv-${a}`))]})}const Xve=({swarm:{extendedCsvFiles:e,statsHistoryEnabled:t}})=>({extendedCsvFiles:e,statsHistoryEnabled:t}),Zve=Ln(Xve)(Yve);var lk={},Kve=Ou;Object.defineProperty(lk,"__esModule",{value:!0});var W6=lk.default=void 0,Qve=Kve(Nu()),Jve=D,ege=(0,Qve.default)((0,Jve.jsx)("path",{d:"M14.67 5v14H9.33V5h5.34zm1 14H21V5h-5.33v14zm-7.34 0V5H3v14h5.33z"}),"ViewColumn");W6=lk.default=ege;function tge({structure:e,selectedColumns:t,addColumn:r,removeColumn:n}){const[i,a]=O.useState(null);return D.jsxs(fG,{direction:"row",justifyContent:"end",my:2,spacing:1,children:[D.jsx(qa,{onClick:o=>a(o.currentTarget),variant:"outlined",children:D.jsx(W6,{})}),D.jsx(_G,{anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},onClose:()=>a(null),open:!!i,children:D.jsx(hG,{sx:{p:2},children:e.map(({key:o,title:s})=>D.jsx(dG,{control:D.jsx(Ise,{checked:t.includes(o),onChange:()=>{t.includes(o)?n(o):r(o)}}),label:s},o))})})]})}function rge(e){const[t,r]=O.useState(e.map(o=>o.key));return{selectedColumns:t,addColumn:o=>{r([...t,o])},removeColumn:o=>{r(t.filter(s=>s!==o))},filteredStructure:(o=>o.filter(s=>t.includes(s.key)))(e)}}const nge=Ra.percentilesToStatistics?Ra.percentilesToStatistics.map(e=>({title:`${e*100}%ile (ms)`,key:`responseTimePercentile${e}`})):[],gE=[{key:"method",title:"Type"},{key:"name",title:"Name"},{key:"numRequests",title:"# Requests"},{key:"numFailures",title:"# Fails"},{key:"medianResponseTime",title:"Median (ms)",round:2},...nge,{key:"avgResponseTime",title:"Average (ms)",round:2},{key:"minResponseTime",title:"Min (ms)"},{key:"maxResponseTime",title:"Max (ms)"},{key:"avgContentLength",title:"Average size (bytes)",round:2},{key:"currentRps",title:"Current RPS",round:2},{key:"currentFailPerSec",title:"Current Failures/s",round:2}];function j6({stats:e}){const{selectedColumns:t,addColumn:r,removeColumn:n,filteredStructure:i}=rge(gE);return D.jsxs(D.Fragment,{children:[D.jsx(tge,{addColumn:r,removeColumn:n,selectedColumns:t,structure:gE}),D.jsx(qf,{hasTotalRow:!0,rows:e,structure:i})]})}const ige=({ui:{stats:e}})=>({stats:e}),age=Ln(ige)(j6);/*! *****************************************************************************
172
172
  Copyright (c) Microsoft Corporation.
173
173
 
174
174
  Permission to use, copy, modify, and/or distribute this software for any
@@ -7,7 +7,7 @@
7
7
  <meta name="theme-color" content="#000000" />
8
8
 
9
9
  <title>Locust</title>
10
- <script type="module" crossorigin src="./assets/index-fd3e763b.js"></script>
10
+ <script type="module" crossorigin src="./assets/index-941b6e82.js"></script>
11
11
  </head>
12
12
  <body>
13
13
  <div id="root"></div>
@@ -7,7 +7,7 @@
7
7
  <meta name="theme-color" content="#000000" />
8
8
 
9
9
  <title>Locust</title>
10
- <script type="module" crossorigin src="./assets/index-fd3e763b.js"></script>
10
+ <script type="module" crossorigin src="./assets/index-941b6e82.js"></script>
11
11
  </head>
12
12
  <body>
13
13
  <div id="root"></div>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: locust
3
- Version: 2.24.1.dev23
3
+ Version: 2.24.2.dev8
4
4
  Summary: Developer friendly load testing framework
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/locustio/locust
@@ -1,6 +1,6 @@
1
1
  locust/__init__.py,sha256=g6oA-Ba_hs3gLWVf5MKJ1mvfltI8MFnDWG8qslqm8yg,1402
2
2
  locust/__main__.py,sha256=vBQ82334kX06ImDbFlPFgiBRiLIinwNk3z8Khs6hd74,31
3
- locust/_version.py,sha256=hPTq7pJLwGM71BgdtqkWwSDZ4wOeoFHMxMCrtuF-ANU,428
3
+ locust/_version.py,sha256=bAEcz2Qz2n-X-EUhNpeiWYbH2b8WU7ifl2M-cBOmoqs,426
4
4
  locust/argument_parser.py,sha256=iDnCJNs9ySKOrIn6xZjZXN3YIelOPC1FSR2MK5nEHP4,31973
5
5
  locust/clients.py,sha256=o3G9welWb-zhgDUM5TKnMVFMJckr_m0FI8Dxn3OtBUA,14810
6
6
  locust/debug.py,sha256=We6Z9W0btkKSc7PxWmrZx-xMynvOOsKhG6jmDgQin0g,5134
@@ -13,7 +13,7 @@ locust/input_events.py,sha256=QBO6Kb0bmNLZHaIvcBORk57CvCJHAYVB5ILfpV8Lrfc,3292
13
13
  locust/log.py,sha256=2IVp9YL4ZPfWdj3sBFuOHfgneg3g7m7tUGR-sy2s3E8,3155
14
14
  locust/main.py,sha256=8DvGTqRXxFZu6Z_rmPRJt6Ox-2cCkxks9j-iZGRrQiU,28866
15
15
  locust/py.typed,sha256=gkWLl8yD4mIZnNYYAIRM8g9VarLvWmTAFeUfEbxJLBw,65
16
- locust/runners.py,sha256=NKjxwtXIXbMRhwMD1duC9rcRUcHhlNBNkA0EcdM9WkQ,67428
16
+ locust/runners.py,sha256=zoepC10fGP248Y4SyoHFDKuGcYQHV9Vi3brpPSKn5zg,67851
17
17
  locust/shape.py,sha256=t-lwBS8LOjWcKXNL7j2U3zroIXJ1b0fazUwpRYQOKXw,1973
18
18
  locust/stats.py,sha256=BXvAybKiqI6QF5THdnk-fWkL-FiZKwrAm2W8KzkTchg,46118
19
19
  locust/web.py,sha256=DVcx53VXApAc6kFfG7so2_kB_qqcw7ojKpBd-dJoijU,28267
@@ -64,7 +64,7 @@ locust/test/test_log.py,sha256=YPY6vgTAy1KaNU2qoVvQrTH5x_mzRrljEHrkSBy3yxs,7553
64
64
  locust/test/test_main.py,sha256=Fgvae1Nas7DyIlWmTjJ-2dhBZmVv2Pj9Cqa-r0Z4SN8,83712
65
65
  locust/test/test_old_wait_api.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
66
  locust/test/test_parser.py,sha256=eV3HSKWkgr9wh87ZcO3-bt2sg8vYS99LnJ9yRCyMahE,18309
67
- locust/test/test_runners.py,sha256=1gUAi41-DurCMJkvWr2dPKw7Uu36gqLyFWZ2dMoyX8o,158561
67
+ locust/test/test_runners.py,sha256=6PDbv4Fyv6vLBJCl7ghEh_wGlFy80Ha8M0zixRvC2LM,159328
68
68
  locust/test/test_sequential_taskset.py,sha256=QjVMWWfGHn9hU5AvPxRDU7Vo5DcVW1VkMVfDA0k9OPE,3398
69
69
  locust/test/test_stats.py,sha256=g5WXKbKtjtPxR_Ixukz04wZUsEC7RkHx5hCNHzofob4,33928
70
70
  locust/test/test_tags.py,sha256=mzhGLPMizSnSItTHLHizYvloxDfuIDAOgelwInyrf28,13138
@@ -89,15 +89,15 @@ locust/util/exception_handler.py,sha256=jTMyBq2a0O07fRjmqGkheyaPj58tUgnbbcjoesKG
89
89
  locust/util/load_locustfile.py,sha256=hn70KcIG8jHmZyuKv2pcEmwgWtOEu24Efeji1KRYNUE,2964
90
90
  locust/util/rounding.py,sha256=5haxR8mKhATqag6WvPby-MSRRgIw5Ob6thbyvMYZM7o,92
91
91
  locust/util/timespan.py,sha256=rrMk4AR5t9HA59GktWCvOsYBDhkKAwLkk0Orj-l2EGY,997
92
- locust/webui/dist/auth.html,sha256=h9IM0pftOpXYo2v_5DS5T7y3qPC9R6CSc8tV1TfiVjY,501
93
- locust/webui/dist/index.html,sha256=RrPEvP5SQQKf-UQv92ugmgEtMwoX_bzd941lnDcNnI4,901
92
+ locust/webui/dist/auth.html,sha256=xDquX2awbYPO0FHo0SUTeylBjwbwUWpu2_blXKD0J5s,501
93
+ locust/webui/dist/index.html,sha256=7LG5sNTcH3Hu07hxAdlpSRTy5fCHq1tNekJo-ZfaWxI,901
94
94
  locust/webui/dist/report.html,sha256=sOdZZVgZbqgu86BBCSQf3uQUYXgmgSnXF32JpnyAII8,513
95
95
  locust/webui/dist/assets/favicon.ico,sha256=IUl-rYqfpHdV38e-s0bkmFIeLS-n3Ug0DQxk-h202hI,8348
96
- locust/webui/dist/assets/index-fd3e763b.js,sha256=n8qy95UxWB9i0OHsu3_mNxakF1gzablbwprGmvkoLoA,1645590
96
+ locust/webui/dist/assets/index-941b6e82.js,sha256=G3n5R81Svt0HzbWaV3AV20jLWGLr4X50UZ-Adu2KcxU,1645614
97
97
  locust/webui/dist/assets/logo.png,sha256=EIVPqr6wE_yqguHaqFHIsH0ZACLSrvNWyYO7PbyIj4w,19299
98
- locust-2.24.1.dev23.dist-info/LICENSE,sha256=78XGpIn3fHVBfaxlPNUfjVufSN7QsdhpJMRJHv2AFpo,1095
99
- locust-2.24.1.dev23.dist-info/METADATA,sha256=aTtlp4_llLXcXc6FOVO4W9q8-cbfyYd18MCKuLxSt5Q,7212
100
- locust-2.24.1.dev23.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
101
- locust-2.24.1.dev23.dist-info/entry_points.txt,sha256=RAdt8Ku-56m7bFjmdj-MBhbF6h4NX7tVODR9QNnOg0E,44
102
- locust-2.24.1.dev23.dist-info/top_level.txt,sha256=XSsjgPA8Ggf9TqKVbkwSqZFuPlZ085X13M9orDycE20,7
103
- locust-2.24.1.dev23.dist-info/RECORD,,
98
+ locust-2.24.2.dev8.dist-info/LICENSE,sha256=78XGpIn3fHVBfaxlPNUfjVufSN7QsdhpJMRJHv2AFpo,1095
99
+ locust-2.24.2.dev8.dist-info/METADATA,sha256=q562vjHBp2dCMS_AHdGaineLy2dSzHufvox5iVroO7g,7211
100
+ locust-2.24.2.dev8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
101
+ locust-2.24.2.dev8.dist-info/entry_points.txt,sha256=RAdt8Ku-56m7bFjmdj-MBhbF6h4NX7tVODR9QNnOg0E,44
102
+ locust-2.24.2.dev8.dist-info/top_level.txt,sha256=XSsjgPA8Ggf9TqKVbkwSqZFuPlZ085X13M9orDycE20,7
103
+ locust-2.24.2.dev8.dist-info/RECORD,,