serverless-artillery
Version:
A serverless performance testing tool. `serverless` + `artillery` = crush. a.k.a. Orbital Laziers [sic]
2 lines • 4.09 kB
JavaScript
!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.rolex=t()}}(function(){return function t(e,n,i){function r(u,a){if(!n[u]){if(!e[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(o)return o(u,!0);throw new Error("Cannot find module '"+u+"'")}var l=n[u]={exports:{}};e[u][0].call(l.exports,function(t){var n=e[u][1][t];return r(n?n:t)},l,l.exports,t,e,n,i)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u<i.length;u++)r(i[u]);return r}({1:[function(t,e){(function(n){function i(t,e,n){if(!i.isRolex(this))return new i(t,e,n);"undefined"==typeof n&&(n=e,e=null);var r={repeat:e,tick:n,threshold:null,aggression:null};return r=o(r,isNaN(t)?t:{duration:t}),this._data={state:"stopped",count:0},this.tick(r.tick),this.duration(r.duration),this.repeat(r.repeat),this.threshold(r.threshold),this.aggression(r.aggression),this}var r=t("present"),o=function(t){return[].slice.call(arguments,1).forEach(function(e){for(var n in e||{})t[n]=e[n]}),t},u=function(t,e,n){return i.apply(null,[n,t,e].concat([].slice.call(arguments,3))).start()},a=function(t,e){return i.isRolex(e)?void e.stop():(t?i.clearInterval:i.clearTimeout)(e)};o(i,{isRolex:function(t){return t instanceof i},setTimeout:n.setTimeout,_setTimeout:n.setTimeout.bind(null),clearTimeout:n.clearTimeout,_clearTimeout:n.clearTimeout.bind(null),setInterval:n.setInterval,clearInterval:n.clearInterval,noConflict:function(){n.setTimeout=i.setTimeout,n.clearTimeout=i.clearTimeout,n.setInterval=i.setInterval,n.clearInterval=i.clearInterval},conflictInterval:function(){n.setInterval=u.bind(null,!0),n.clearInterval=a.bind(null,!0)},conflict:function(){i.conflictInterval(),n.setTimeout=u.bind(null,!1),n.clearTimeout=a.bind(null,!1)},_getterSetters:{tick:{type:function(t){return t&&"function"==typeof t.call?t:new Function(t)}},duration:{type:Number},repeat:{type:null,defaultVal:1},threshold:{type:Number,defaultVal:1},aggression:{type:Number,defaultVal:1.1}},_coerce:function(t,e){var n=i._getterSetters[t],r=n.type||i._identity;return"undefined"==typeof e?void 0:r(null===e&&"defaultVal"in n?n.defaultVal:e)},_identity:function(t){return t}}),o(i.prototype,{start:function(){var t,e=this._data,n=r();if("started"!==this.state()&&(e.state="started",e.count=0,e.startTime=n),t=this.tickTime()-n,t!==t)throw TypeError("msToTick is NaN");return t<=this.threshold()&&(e.count++,this.tick().call(this),"stopped"===this.state()||this.isLastTick())?this.stop():(e.timeoutID=i._setTimeout(this.start.bind(this),t/this.aggression()),this)},stop:function(){var t=this._data;return"timeoutID"in t&&i._clearTimeout(t.timeoutID),t.state="stopped",this},tickTime:function(t){return"started"===this.state()?this.startTime()+this.duration()*(this.count()+("undefined"!=typeof t?t:1)):void 0},isLastTick:function(){return this.repeat()!==!0&&this.count()>=this.repeat()},runTime:function(){return"started"===this.state()?r()-this.startTime():0},count:function(){return this._data.count},state:function(){return this._data.state},startTime:function(){return this._data.startTime}}),Object.keys(i._getterSetters).forEach(function(t){i.prototype[t]=function(e){var n=this._data;return arguments.length?(n[t]=i._coerce(t,e),this):n[t]}}),i.conflictInterval(),e.exports=i}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{present:2}],2:[function(t,e){(function(t){var n=t.performance||{},i=function(){for(var t=["now","webkitNow","msNow","mozNow","oNow"];t.length;){var e=t.shift();if(e in n)return n[e].bind(n)}var i=Date.now||function(){return+new Date},r=(n.timing||{}).navigationStart||i();return function(){return i()-r}}();i.performanceNow=n.now,i.noConflict=function(){n.now=i.performanceNow},i.conflict=function(){n.now=i},i.conflict(),e.exports=i}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});
//# sourceMappingURL=rolex.min.js.map