jupyter-resource-usage
Advanced tools
| (self.webpackChunk_jupyter_server_resource_usage=self.webpackChunk_jupyter_server_resource_usage||[]).push([[114],{114:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TypeStyle:()=>R,classes:()=>$,createTypeStyle:()=>W,cssRaw:()=>A,cssRule:()=>O,extend:()=>x,fontFace:()=>F,forceRenderStyles:()=>U,getStyles:()=>q,keyframes:()=>N,media:()=>b,reinit:()=>H,setStylesTarget:()=>T,style:()=>G,stylesheet:()=>z,types:()=>I});let s=0;const r=Object.create(null),i=["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","columns","counter-increment","counter-reset","flex","flex-grow","flex-positive","flex-shrink","flex-negative","flex-order","font-weight","grid-area","grid-column","grid-column-end","grid-column-span","grid-column-start","grid-row","grid-row-end","grid-row-span","grid-row-start","line-clamp","line-height","opacity","order","orphans","tab-size","widows","z-index","zoom","fill-opacity","flood-opacity","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width"];for(const e of i)for(const t of["-webkit-","-ms-","-moz-","-o-",""])r[t+e]=!0;function o(e,t){return t&&"number"==typeof t&&!r[e]?`${e}:${t}px`:`${e}:${t}`}function a(e){return e.sort(((e,t)=>e[0]>t[0]?1:-1))}function h(e){return e.map((([e,t])=>Array.isArray(t)?t.map((t=>o(e,t))).join(";"):o(e,t))).join(";")}function c(e,t){return-1===e.indexOf("&")?`${t} ${e}`:e.replace(/&/g,t)}function l(e,t,n,s,r){const{style:i,nested:o,isUnique:u}=function(e,t){const n=[],s=[];for(const t of Object.keys(e)){const i=t.trim(),o=e[t];36!==i.charCodeAt(0)&&null!=o&&("object"!=typeof o||Array.isArray(o)?n.push([(r=i,r.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)).replace(/^ms-/,"-ms-")),o]):s.push([i,o]))}var r;return{style:h(a(n)),nested:t?s:a(s),isUnique:!!e.$unique}}(t,""!==e);let d=i;if(64===e.charCodeAt(0)){const t={selector:e,styles:[],rules:[],style:r?"":i};n.push(t),i&&r&&t.styles.push({selector:r,style:i,isUnique:u});for(const[e,n]of o)d+=e+l(e,n,t.rules,t.styles,r)}else{const t=r?c(e,r):e;i&&s.push({selector:t,style:i,isUnique:u});for(const[e,r]of o)d+=e+l(e,r,n,s,t)}return d}function u(e,t,n,r,i,o){for(const{selector:n,style:a,isUnique:h}of r){const r=o?c(n,i):n,l=h?`u\0${(++s).toString(36)}`:`s\0${t}\0${a}`,u=new p(a,l);u.add(new y(r,`k\0${t}\0${r}`)),e.add(u)}for(const{selector:s,style:r,rules:a,styles:h}of n){const n=new m(s,r,`r\0${t}\0${s}\0${r}`);u(n,t,a,h,i,o),e.add(n)}}function d(e){let t="";for(let n=0;n<e.length;n++)t+=e[n];return t}const f={add:()=>{},change:()=>{},remove:()=>{}};class g{constructor(e=f){this.changes=e,this.sheet=[],this.changeId=0,this._keys=[],this._children=Object.create(null),this._counters=Object.create(null)}add(e){const t=this._counters[e.id]||0,n=this._children[e.id]||e.clone();if(this._counters[e.id]=t+1,0===t)this._children[n.id]=n,this._keys.push(n.id),this.sheet.push(n.getStyles()),this.changeId++,this.changes.add(n,this._keys.length-1);else if(n instanceof g&&e instanceof g){const t=this._keys.indexOf(e.id),s=n.changeId;n.merge(e),n.changeId!==s&&(this.sheet.splice(t,1,n.getStyles()),this.changeId++,this.changes.change(n,t,t))}}remove(e){const t=this._counters[e.id];if(t){this._counters[e.id]=t-1;const n=this._children[e.id],s=this._keys.indexOf(n.id);if(1===t)delete this._counters[e.id],delete this._children[e.id],this._keys.splice(s,1),this.sheet.splice(s,1),this.changeId++,this.changes.remove(n,s);else if(n instanceof g&&e instanceof g){const t=n.changeId;n.unmerge(e),n.changeId!==t&&(this.sheet.splice(s,1,n.getStyles()),this.changeId++,this.changes.change(n,s,s))}}}values(){return this._keys.map((e=>this._children[e]))}merge(e){for(const t of e.values())this.add(t);return this}unmerge(e){for(const t of e.values())this.remove(t);return this}clone(){return(new g).merge(this)}}class y{constructor(e,t){this.selector=e,this.id=t}getStyles(){return this.selector}clone(){return this}}class p extends g{constructor(e,t){super(),this.style=e,this.id=t}getStyles(){return`${this.sheet.join(",")}{${this.style}}`}clone(){return new p(this.style,this.id).merge(this)}}class m extends g{constructor(e,t,n){super(),this.rule=e,this.style=t,this.id=n}getStyles(){return`${this.rule}{${this.style}${d(this.sheet)}}`}clone(){return new m(this.rule,this.style,this.id).merge(this)}}function _(e,t){return`f${function(e){let t=5381,n=e.length;for(;n--;)t=33*t^e.charCodeAt(n);return(t>>>0).toString(36)}(e)}`}class v extends g{constructor(e,t){super(t),this.id=e}registerStyle(e){const t=[],n=[],s=l("&",e,t,n),r=_(s);return u(this,s,t,n,`.${r}`,!0),r}registerKeyframes(e){return this.registerHashRule("@keyframes",e)}registerHashRule(e,t){const n=[],s=[],r=l("",t,n,s),i=_(r),o=new m(`${e} ${i}`,"",`h\0${r}\0${e}`);return u(o,r,n,s,"",!1),this.add(o),i}registerRule(e,t){const n=[],s=[];u(this,l(e,t,n,s),n,s,"",!1)}registerCss(e){return this.registerRule("",e)}getStyles(){return d(this.sheet)}clone(){return new v(this.id,this.changes).merge(this)}}function w(e){var t={};for(var n in e){var s=e[n];if("$nest"===n){var r=s;for(var i in r){var o=r[i];t[i]=w(o)}}else"$debugName"===n?t.$displayName=s:t[n]=s}return t}var S="undefined"==typeof requestAnimationFrame?function(e){return setTimeout(e)}:"undefined"==typeof window?requestAnimationFrame:requestAnimationFrame.bind(window);function $(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map((function(e){return e&&"object"==typeof e?Object.keys(e).map((function(t){return!!e[t]&&t})):[e]})).reduce((function(e,t){return e.concat(t)}),[]).filter((function(e){return!!e})).join(" ")}function x(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},s=0,r=e;s<r.length;s++){var i=r[s];if(null!=i&&!1!==i)for(var o in i){var a=i[o];(a||0===a)&&("$nest"===o&&a?n[o]=n.$nest?x(n.$nest,a):a:-1!==o.indexOf("&")||0===o.indexOf("@media")?n[o]=n[o]?x(n[o],a):a:n[o]=a)}}return n}var b=function(e){for(var t,n=[],s=1;s<arguments.length;s++)n[s-1]=arguments[s];var r=[];e.type&&r.push(e.type),e.orientation&&r.push("(orientation: "+e.orientation+")"),e.minWidth&&r.push("(min-width: "+k(e.minWidth)+")"),e.maxWidth&&r.push("(max-width: "+k(e.maxWidth)+")"),e.minHeight&&r.push("(min-height: "+k(e.minHeight)+")"),e.maxHeight&&r.push("(max-height: "+k(e.maxHeight)+")"),e.prefersColorScheme&&r.push("(prefers-color-scheme: "+e.prefersColorScheme+")");var i="@media "+r.join(" and "),o={$nest:(t={},t[i]=x.apply(void 0,n),t)};return o},k=function(e){return"string"==typeof e?e:e+"px"},C=function(){return new v(`f${(++s).toString(36)}`,undefined)},R=function(){function e(e){var t=this,n=e.autoGenerateTag;this.cssRaw=function(e){e&&(t._raw+=e||"",t._pendingRawChange=!0,t._styleUpdated())},this.cssRule=function(e){for(var n=[],s=1;s<arguments.length;s++)n[s-1]=arguments[s];var r=w(x.apply(void 0,n));t._freeStyle.registerRule(e,r),t._styleUpdated()},this.forceRenderStyles=function(){var e=t._getTag();e&&(e.textContent=t.getStyles())},this.fontFace=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var s=t._freeStyle,r=0,i=e;r<i.length;r++){var o=i[r];s.registerRule("@font-face",o)}t._styleUpdated()},this.getStyles=function(){return(t._raw||"")+t._freeStyle.getStyles()},this.keyframes=function(e){var n=function(e){var t={};for(var n in e)"$debugName"!==n&&(t[n]=e[n]);return e.$debugName&&(t.$displayName=e.$debugName),t}(e),s=t._freeStyle.registerKeyframes(n);return t._styleUpdated(),s},this.reinit=function(){var e=C();t._freeStyle=e,t._lastFreeStyleChangeId=e.changeId,t._raw="",t._pendingRawChange=!1;var n=t._getTag();n&&(n.textContent="")},this.setStylesTarget=function(e){t._tag&&(t._tag.textContent=""),t._tag=e,t.forceRenderStyles()},this.stylesheet=function(e){for(var n={},s=0,r=Object.getOwnPropertyNames(e);s<r.length;s++){var i=r[s],o=e[i];o&&(o.$debugName=i,n[i]=t.style(o))}return n};var s=C();this._autoGenerateTag=n,this._freeStyle=s,this._lastFreeStyleChangeId=s.changeId,this._pending=0,this._pendingRawChange=!1,this._raw="",this._tag=void 0,this.style=this.style.bind(this)}return e.prototype._afterAllSync=function(e){var t=this;this._pending++;var n=this._pending;S((function(){n===t._pending&&e()}))},e.prototype._getTag=function(){if(this._tag)return this._tag;if(this._autoGenerateTag){var e="undefined"==typeof window?{textContent:""}:document.createElement("style");return"undefined"!=typeof document&&document.head.appendChild(e),this._tag=e,e}},e.prototype._styleUpdated=function(){var e=this,t=this._freeStyle.changeId,n=this._lastFreeStyleChangeId;(this._pendingRawChange||t!==n)&&(this._lastFreeStyleChangeId=t,this._pendingRawChange=!1,this._afterAllSync((function(){return e.forceRenderStyles()})))},e.prototype.style=function(){var e=this._freeStyle.registerStyle(w(x.apply(void 0,arguments)));return this._styleUpdated(),e},e}(),I=n(724),j=new R({autoGenerateTag:!0}),T=j.setStylesTarget,A=j.cssRaw,O=j.cssRule,U=j.forceRenderStyles,F=j.fontFace,q=j.getStyles,N=j.keyframes,H=j.reinit,G=j.style,z=j.stylesheet;function W(e){var t=new R({autoGenerateTag:!1});return e&&t.setStylesTarget(e),t}},724:()=>{}}]); |
| "use strict";(self.webpackChunk_jupyter_server_resource_usage=self.webpackChunk_jupyter_server_resource_usage||[]).push([[135],{135:(e,t,s)=>{s.r(t),s.d(t,{default:()=>N});var r=s(142),a=s(544),n=s(740),o=s(992),i=s(271),l=s.n(i),c=s(15),m=s(305);const u={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776,PB:0x4000000000000};function d(e){const t=_(e);return t[0].toFixed(2)+" "+t[1]}function _(e){return e?e<u.KB?[e,"B"]:u.KB===e||e<u.MB?[e/u.KB,"KB"]:u.MB===e||e<u.GB?[e/u.MB,"MB"]:u.GB===e||e<u.TB?[e/u.GB,"GB"]:u.TB===e||e<u.PB?[e/u.TB,"TB"]:[e/u.PB,"PB"]:[0,"B"]}let h=null;const p=e=>{var t;const{panel:s}=e,[r,a]=(0,i.useState)(),[n,o]=(0,i.useState)(),[u,_]=(0,i.useState)();((e,t)=>{const s=(0,i.useRef)();(0,i.useEffect)((()=>{s.current=e}),[e]),(0,i.useEffect)((()=>{if(null!==t){const e=setInterval((function(){s.current&&s.current()}),t);return()=>{clearInterval(e)}}}),[e,t])})((async()=>{r&&s.isVisible&&p(r).then((e=>_(e))).catch((()=>{console.warn(`Request failed for ${r}. Kernel restarting?`)}))}),5e3);const p=e=>async function(e="",t={}){const s=m.ServerConnection.makeSettings(),r=c.URLExt.join(s.baseUrl,"api/metrics/v1/kernel_usage",e);let a;try{a=await m.ServerConnection.makeRequest(r,t,s)}catch(e){throw new m.ServerConnection.NetworkError(e)}let n=await a.text();if(n.length>0)try{n=JSON.parse(n)}catch(e){console.log("Not a JSON response body.",a)}if(!a.ok)throw new m.ServerConnection.ResponseError(a,n.message||n);return n}(`get_usage/${e}`).then((t=>Object.assign(Object.assign({},t.content),{kernelId:e,timestamp:new Date})));return(0,i.useEffect)((()=>{const t=e=>(t,s)=>{var r,n;const i=null===(r=s.newValue)||void 0===r?void 0:r.id;if(i){a(i);const t=null===(n=null==e?void 0:e.sessionContext.session)||void 0===n?void 0:n.model.path;o(t),p(i).then((e=>_(e)))}else a(i)},s=(e,s)=>{var n,i,l,c,m;if(null!==s&&(h&&h.panel.sessionContext.kernelChanged.disconnect(h.callback),h={callback:t(s),panel:s},s.sessionContext.kernelChanged.connect(h.callback),(null===(i=null===(n=s.sessionContext.session)||void 0===n?void 0:n.kernel)||void 0===i?void 0:i.id)!==r)){const e=null===(c=null===(l=s.sessionContext.session)||void 0===l?void 0:l.kernel)||void 0===c?void 0:c.id;if(e){a(e);const t=null===(m=s.sessionContext.session)||void 0===m?void 0:m.model.path;o(t),p(e).then((e=>_(e)))}}};return e.currentNotebookChanged.connect(s),()=>{e.currentNotebookChanged.disconnect(s)}}),[r]),r&&u?u.hostname?l().createElement(l().Fragment,null,l().createElement("h3",{className:"jp-KernelUsage-section-separator"},e.trans.__("Kernel usage")),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Kernel Host:")," ",u.hostname),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Notebook:")," ",n),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Kernel ID:")," ",r),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Timestamp:")," ",null===(t=u.timestamp)||void 0===t?void 0:t.toLocaleString()),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Process ID:")," ",u.pid),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("CPU:")," ",u.kernel_cpu),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Memory:")," ",d(u.kernel_memory)),l().createElement("hr",{className:"jp-KernelUsage-section-separator"}),l().createElement("h4",{className:"jp-KernelUsage-section-separator"},e.trans.__("Host CPU")),u.host_cpu_percent&&l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans._n("%2%% used on %1 CPU","%2%% used on %1 CPUs",u.cpu_count,u.host_cpu_percent.toFixed(1))),l().createElement("h4",{className:"jp-KernelUsage-section-separator"},e.trans.__("Host Virtual Memory")),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Active:")," ",d(u.host_virtual_memory.active)),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Available:")," ",d(u.host_virtual_memory.available)),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Free:")," ",d(u.host_virtual_memory.free)),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Inactive:")," ",d(u.host_virtual_memory.inactive)),u.host_virtual_memory.percent&&l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Percent used:")," ",u.host_virtual_memory.percent.toFixed(1),"%"),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Total:")," ",d(u.host_virtual_memory.total)),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Used:")," ",d(u.host_virtual_memory.used)),l().createElement("div",{className:"jp-KernelUsage-separator"},e.trans.__("Wired:")," ",d(u.host_virtual_memory.wired))):l().createElement(l().Fragment,null,l().createElement("h3",{className:"jp-KernelUsage-section-separator"},e.trans.__("Kernel usage details are not available")),l().createElement("div",{className:"jp-KernelUsage-section-separator"},e.trans.__("Please check with your system administrator that you are running IPyKernel version 6.10.0 or above."))):l().createElement("h3",null,e.trans.__("Kernel usage is not available"))};class g extends n.ReactWidget{constructor(e){super(),this._widgetAdded=e.widgetAdded,this._currentNotebookChanged=e.currentNotebookChanged,this._panel=e.panel,this._trans=e.trans}render(){return l().createElement(p,{widgetAdded:this._widgetAdded,currentNotebookChanged:this._currentNotebookChanged,panel:this._panel,trans:this._trans})}}const v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\r\n <g class="jp-icon3" fill="#616161">\r\n <path d="m256 43c-141 0-256 115-256 256 0 62 22 118 59 163l6 8h383l6-8c37-44 59-101 59-163-0.1-141-115-256-256-256zm0 43c118 0 213 95 213 213 0 48-17 92-44 128h-339c-27-36-44-80-44-128 0-118 95-213 213-213zm0 21c-12 0-21 9.6-21 21s9.6 21 21 21 21-9.6 21-21-9.5-21-21-21zm-85 23c-12 0-21 9.6-21 21s9.6 21 21 21 21-9.6 21-21-9.6-21-21-21zm171 0c-12 0-21 9.6-21 21s9.6 21 21 21 21-9.6 21-21-9.5-21-21-21zm-233 63c-12 0-21 9.6-21 21s9.6 21 21 21 21-9.6 21-21-9.5-21-21-21zm290 0.7-121 69c-6.3-3.7-14-6-21-6-24 0-43 19-43 43s19 43 43 43c23 0 42-19 43-42v-0.7l121-69-21-37zm-313 85c-12 0-21 9.6-21 21s9.6 21 21 21 21-9.6 21-21-9.5-21-21-21zm341 0c-12 0-21 9.6-21 21s9.6 21 21 21 21-9.6 21-21-9.6-21-21-21zm-319 85c-12 0-21 9.6-21 21s9.6 21 21 21 21-9.6 21-21-9.5-21-21-21zm296 0c-12 0-21 9.6-21 21s9.6 21 21 21 21-9.6 21-21-9.5-21-21-21z"/>\r\n </g>\r\n</svg>\r\n\x3c!-- Downloaded from https://seekicon.com/free-icon/tachometer-alt_1 under MIT License. --\x3e\r\n';class y extends o.StackedPanel{constructor(e){super(),this.addClass("jp-KernelUsage-view"),this.id="kernelusage-panel-id",this.title.caption=e.trans.__("Kernel Usage"),this.title.icon=new a.LabIcon({name:"jupyterlab-kernel-usage:icon",svgstr:v}),this.title.closable=!0;const t=new g({widgetAdded:e.widgetAdded,currentNotebookChanged:e.currentNotebookChanged,panel:this,trans:e.trans});this.addWidget(t)}dispose(){super.dispose()}onCloseRequest(e){super.onCloseRequest(e),this.dispose()}}var C=s(134),f=s(191),b=s(722);const k=(0,s(519).style)({fontSize:"var(--jp-ui-font-size1)",fontFamily:"var(--jp-ui-font-family)"},{backgroundColor:"#FFD2D2",color:"#D8000C"});class w extends n.VDomRenderer{constructor(e){super(new w.Model({refreshRate:5e3})),this._trans=e}render(){if(!this.model)return l().createElement("div",null);let e;return e=null===this.model.memoryLimit?this._trans.__("Mem: %1 %2",this.model.currentMemory.toFixed(E.DECIMAL_PLACES),this.model.units):this._trans.__("Mem: %1 / %2 %3",this.model.currentMemory.toFixed(E.DECIMAL_PLACES),this.model.memoryLimit.toFixed(E.DECIMAL_PLACES),this.model.units),this.model.usageWarning?l().createElement(C.TextItem,{title:this._trans.__("Current memory usage"),source:e,className:k}):l().createElement(C.TextItem,{title:this._trans.__("Current memory usage"),source:e})}}var E,K;!function(e){class t extends n.VDomModel{constructor(e){super(),this._currentMemory=0,this._memoryLimit=null,this._metricsAvailable=!1,this._units="B",this._warn=!1,this._poll=new b.Poll({factory:()=>E.factory(),frequency:{interval:e.refreshRate,backoff:!0},name:"@jupyterlab/statusbar:MemoryUsage#metrics"}),this._poll.ticked.connect((e=>{const{payload:t,phase:s}=e.state;if("resolved"!==s){if("rejected"===s){const e=this._metricsAvailable;return this._metricsAvailable=!1,this._currentMemory=0,this._memoryLimit=null,this._units="B",void(e&&this.stateChanged.emit())}}else this._updateMetricsValues(t)}))}get metricsAvailable(){return this._metricsAvailable}get currentMemory(){return this._currentMemory}get memoryLimit(){return this._memoryLimit}get units(){return this._units}get usageWarning(){return this._warn}dispose(){super.dispose(),this._poll.dispose()}_updateMetricsValues(e){const t=this._metricsAvailable,s=this._currentMemory,r=this._memoryLimit,a=this._units,n=this._warn;if(null===e)this._metricsAvailable=!1,this._currentMemory=0,this._memoryLimit=null,this._units="B",this._warn=!1;else{const t=e.rss,s=e.limits.memory?e.limits.memory.rss:null,[r,a]=_(t),n=!!e.limits.memory&&e.limits.memory.warn;this._metricsAvailable=!0,this._currentMemory=r,this._units=a,this._memoryLimit=s?s/u[a]:null,this._warn=n}this._currentMemory===s&&this._units===a&&this._memoryLimit===r&&this._metricsAvailable===t&&this._warn===n||this.stateChanged.emit(void 0)}}e.Model=t}(w||(w={})),function(e){e.DECIMAL_PLACES=2;const t=m.ServerConnection.makeSettings(),s=c.URLExt.join(t.baseUrl,"api/metrics/v1");e.factory=async function(){const e=m.ServerConnection.makeRequest(s,{},t),r=await e;return await r.json()}}(E||(E={})),function(e){e.getKernelUsage="kernel-usage:get"}(K||(K={}));const j={id:"@jupyter-server/resource-usage:memory-status-item",autoStart:!0,requires:[C.IStatusBar,f.ITranslator],activate:(e,t,s)=>{const r=s.load("jupyter-resource-usage"),a=new w(r);t.registerStatusItem(j.id,{item:a,align:"left",rank:2,isActive:()=>a.model.metricsAvailable,activeStateChanged:a.model.stateChanged})}},U={id:"@jupyter-server/resource-usage:kernel-panel-item",autoStart:!0,optional:[n.ICommandPalette],requires:[f.ITranslator,r.INotebookTracker],activate:(e,t,s,r)=>{const n=t.load("jupyter-resource-usage"),{commands:o,shell:i}=e,l=n.__("Kernel Resource");let c=null;function m(){c&&!c.isDisposed||!s||(c=new y({widgetAdded:s.widgetAdded,currentNotebookChanged:s.currentChanged,trans:n}),i.add(c,"right",{rank:200}))}o.addCommand(K.getKernelUsage,{label:n.__("Kernel Usage"),caption:n.__("Kernel Usage"),icon:new a.LabIcon({name:"jupyterlab-kernel-usage:icon",svgstr:v}),execute:m}),r&&r.addItem({command:K.getKernelUsage,category:l}),m()}},N=[j,U]}}]); |
| "use strict";(self.webpackChunk_jupyter_server_resource_usage=self.webpackChunk_jupyter_server_resource_usage||[]).push([[361],{361:(t,e,n)=>{n.r(e),n.d(e,{Debouncer:()=>y,Poll:()=>f,RateLimiter:()=>d,Throttler:()=>m});var i=n(526),r=n(840),o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)};function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},a.apply(this,arguments)};function u(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))}function c(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var l,p="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate,h="function"==typeof cancelAnimationFrame?cancelAnimationFrame:clearImmediate,f=function(){function t(t){var e=this;this._disposed=new r.Signal(this),this._tick=new i.PromiseDelegate,this._ticked=new r.Signal(this),this._timeout=-1,this._factory=t.factory,this._standby=t.standby||l.DEFAULT_STANDBY,this._state=a(a({},l.DEFAULT_STATE),{timestamp:(new Date).getTime()});var n=t.frequency||{},o=Math.max(n.interval||0,n.max||0,l.DEFAULT_FREQUENCY.max);this.frequency=a(a(a({},l.DEFAULT_FREQUENCY),n),{max:o}),this.name=t.name||l.DEFAULT_NAME,"auto"in t&&!t.auto||p((function(){e.start()}))}return Object.defineProperty(t.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"frequency",{get:function(){return this._frequency},set:function(e){if(!this.isDisposed&&!i.JSONExt.deepEqual(e,this.frequency||{})){var n=e.backoff,r=e.interval,o=e.max;if(r=Math.round(r),o=Math.round(o),"number"==typeof n&&n<1)throw new Error("Poll backoff growth factor must be at least 1");if((r<0||r>o)&&r!==t.NEVER)throw new Error("Poll interval must be between 0 and max");if(o>t.MAX_INTERVAL&&o!==t.NEVER)throw new Error("Max interval must be less than "+t.MAX_INTERVAL);this._frequency={backoff:n,interval:r,max:o}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return"disposed"===this.state.phase},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"standby",{get:function(){return this._standby},set:function(t){this.isDisposed||this.standby===t||(this._standby=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tick",{get:function(){return this._tick.promise},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ticked",{get:function(){return this._ticked},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this._state=a(a({},l.DISPOSED_STATE),{timestamp:(new Date).getTime()}),this._tick.promise.catch((function(t){})),this._tick.reject(new Error("Poll ("+this.name+") is disposed.")),this._disposed.emit(void 0),r.Signal.clearData(this))},t.prototype.refresh=function(){return this.schedule({cancel:function(t){return"refreshed"===t.phase},interval:t.IMMEDIATE,phase:"refreshed"})},t.prototype.schedule=function(e){return void 0===e&&(e={}),u(this,void 0,void 0,(function(){var n,r,o,s,u,l=this;return c(this,(function(c){switch(c.label){case 0:return this.isDisposed||e.cancel&&e.cancel(this.state)?[2]:(n=this.state,r=this._tick,o=new i.PromiseDelegate,s=a({interval:this.frequency.interval,payload:null,phase:"standby",timestamp:(new Date).getTime()},e),this._state=s,this._tick=o,n.interval===t.IMMEDIATE?h(this._timeout):clearTimeout(this._timeout),this._ticked.emit(this.state),r.resolve(this),[4,r.promise]);case 1:return c.sent(),u=function(){l.isDisposed||l.tick!==o.promise||l._execute()},this._timeout=s.interval===t.IMMEDIATE?p(u):s.interval===t.NEVER?-1:setTimeout(u,s.interval),[2]}}))}))},t.prototype.start=function(){return this.schedule({cancel:function(t){var e=t.phase;return"constructed"!==e&&"standby"!==e&&"stopped"!==e},interval:t.IMMEDIATE,phase:"started"})},t.prototype.stop=function(){return this.schedule({cancel:function(t){return"stopped"===t.phase},interval:t.NEVER,phase:"stopped"})},t.prototype._execute=function(){var t=this,e="function"==typeof this.standby?this.standby():this.standby;if(e="never"!==e&&("when-hidden"===e?!("undefined"==typeof document||!document||!document.hidden):e))this.schedule();else{var n=this.tick;this._factory(this.state).then((function(e){t.isDisposed||t.tick!==n||t.schedule({payload:e,phase:"rejected"===t.state.phase?"reconnected":"resolved"})})).catch((function(e){t.isDisposed||t.tick!==n||t.schedule({interval:l.sleep(t.frequency,t.state),payload:e,phase:"rejected"})}))}},t}();!function(t){t.IMMEDIATE=0,t.MAX_INTERVAL=2147483647,t.NEVER=1/0}(f||(f={})),function(t){t.DEFAULT_BACKOFF=3,t.DEFAULT_FREQUENCY={backoff:!0,interval:1e3,max:3e4},t.DEFAULT_NAME="unknown",t.DEFAULT_STANDBY="when-hidden",t.DEFAULT_STATE={interval:f.NEVER,payload:null,phase:"constructed",timestamp:new Date(0).getTime()},t.DISPOSED_STATE={interval:f.NEVER,payload:null,phase:"disposed",timestamp:new Date(0).getTime()},t.sleep=function(e,n){var i=e.backoff,r=e.interval,o=e.max;if(r===f.NEVER)return r;var s=!0===i?t.DEFAULT_BACKOFF:!1===i?1:i,a=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}(r,n.interval*s);return Math.min(o,a)}}(l||(l={}));var d=function(){function t(t,e){var n=this;void 0===e&&(e=500),this.args=void 0,this.payload=null,this.limit=e,this.poll=new f({auto:!1,factory:function(){return u(n,void 0,void 0,(function(){var e;return c(this,(function(n){return e=this.args,this.args=void 0,[2,t.apply(void 0,e)]}))}))},frequency:{backoff:!1,interval:f.NEVER,max:f.NEVER},standby:"never"}),this.payload=new i.PromiseDelegate,this.poll.ticked.connect((function(t,e){var r=n.payload;return"resolved"===e.phase?(n.payload=new i.PromiseDelegate,void r.resolve(e.payload)):"rejected"===e.phase||"stopped"===e.phase?(n.payload=new i.PromiseDelegate,r.promise.catch((function(t){})),void r.reject(e.payload)):void 0}),this)}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return null===this.payload},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.args=void 0,this.payload=null,this.poll.dispose())},t.prototype.stop=function(){return u(this,void 0,void 0,(function(){return c(this,(function(t){return[2,this.poll.stop()]}))}))},t}(),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.invoke=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.args=t,this.poll.schedule({interval:this.limit,phase:"invoked"}),this.payload.promise},e}(d),m=function(t){function e(e,n){var i=t.call(this,e,"number"==typeof n?n:n&&n.limit)||this;return i._trailing=!1,"number"!=typeof n&&n&&"trailing"===n.edge&&(i._trailing=!0),i._interval=i._trailing?i.limit:f.IMMEDIATE,i}return s(e,t),e.prototype.invoke=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="invoked"!==this.poll.state.phase;return(n||this._trailing)&&(this.args=t),n&&this.poll.schedule({interval:this._interval,phase:"invoked"}),this.payload.promise},e}(d)}}]); |
| "use strict";(self.webpackChunk_jupyter_server_resource_usage=self.webpackChunk_jupyter_server_resource_usage||[]).push([[643],{246:(e,n,t)=>{t.d(n,{Z:()=>i});var r=t(609),o=t.n(r)()((function(e){return e[1]}));o.push([e.id,".jp-KernelUsage-view {\n overflow: scroll !important;\n padding: 10px;\n background-color: white;\n min-width: 250px !important;\n}\n\n.jp-KernelUsage-section-separator {\n margin-top: 20px;\n margin-bottom: 20px;\n}\n\n.jp-KernelUsage-separator {\n margin-top: 10px;\n margin-bottom: 10px;\n}\n\n.jp-KernelUsage-button {\n background-color: green;\n border-radius: 12px;\n border: none;\n color: white;\n padding: 5px 5px;\n margin: 10px;\n text-align: center;\n text-decoration: none;\n display: inline-block;\n font-size: 12px;\n}\n",""]);const i=o},609:e=>{e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t=e(n);return n[2]?"@media ".concat(n[2]," {").concat(t,"}"):t})).join("")},n.i=function(e,t,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var c=0;c<e.length;c++){var s=[].concat(e[c]);r&&o[s[0]]||(t&&(s[2]?s[2]="".concat(t," and ").concat(s[2]):s[2]=t),n.push(s))}},n}},62:(e,n,t)=>{var r,o=function(){var e={};return function(n){if(void 0===e[n]){var t=document.querySelector(n);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[n]=t}return e[n]}}(),i=[];function a(e){for(var n=-1,t=0;t<i.length;t++)if(i[t].identifier===e){n=t;break}return n}function c(e,n){for(var t={},r=[],o=0;o<e.length;o++){var c=e[o],s=n.base?c[0]+n.base:c[0],u=t[s]||0,l="".concat(s," ").concat(u);t[s]=u+1;var d=a(l),f={css:c[1],media:c[2],sourceMap:c[3]};-1!==d?(i[d].references++,i[d].updater(f)):i.push({identifier:l,updater:h(f,n),references:1}),r.push(l)}return r}function s(e){var n=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=t.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){n.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(n);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}return n}var u,l=(u=[],function(e,n){return u[e]=n,u.filter(Boolean).join("\n")});function d(e,n,t,r){var o=t?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(n,o);else{var i=document.createTextNode(o),a=e.childNodes;a[n]&&e.removeChild(a[n]),a.length?e.insertBefore(i,a[n]):e.appendChild(i)}}function f(e,n,t){var r=t.css,o=t.media,i=t.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var p=null,v=0;function h(e,n){var t,r,o;if(n.singleton){var i=v++;t=p||(p=s(n)),r=d.bind(null,t,i,!1),o=d.bind(null,t,i,!0)}else t=s(n),r=f.bind(null,t,n),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)};return r(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;r(e=n)}else o()}}e.exports=function(e,n){(n=n||{}).singleton||"boolean"==typeof n.singleton||(n.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var t=c(e=e||[],n);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<t.length;r++){var o=a(t[r]);i[o].references--}for(var s=c(e,n),u=0;u<t.length;u++){var l=a(t[u]);0===i[l].references&&(i[l].updater(),i.splice(l,1))}t=s}}}},643:(e,n,t)=>{t.r(n);var r=t(62),o=t.n(r),i=t(246);o()(i.Z,{insert:"head",singleton:!1}),i.Z.locals}}]); |
| var _JUPYTERLAB;(()=>{"use strict";var e,r,t,n,o,a,u,i,l,s,f,d,p,c,h,v,g,b,y={357:(e,r,t)=>{var n={"./index":()=>t.e(135).then((()=>()=>t(135))),"./extension":()=>t.e(135).then((()=>()=>t(135))),"./style":()=>t.e(643).then((()=>()=>t(643)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},m={};function w(e){var r=m[e];if(void 0!==r)return r.exports;var t=m[e]={id:e,exports:{}};return y[e](t,t.exports,w),t.exports}w.m=y,w.c=m,w.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return w.d(r,{a:r}),r},w.d=(e,r)=>{for(var t in r)w.o(r,t)&&!w.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},w.f={},w.e=e=>Promise.all(Object.keys(w.f).reduce(((r,t)=>(w.f[t](e,r),r)),[])),w.u=e=>e+"."+{60:"8ac5570d19ebc1332769",114:"f007732a4d436149ea48",135:"7cb9ac4aa0ab3f972930",361:"fa4d5aead5d48c87a0d3",643:"bb8b6dae69fd08b5d52f"}[e]+".js?v="+{60:"8ac5570d19ebc1332769",114:"f007732a4d436149ea48",135:"7cb9ac4aa0ab3f972930",361:"fa4d5aead5d48c87a0d3",643:"bb8b6dae69fd08b5d52f"}[e],w.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),w.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@jupyter-server/resource-usage:",w.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var u,i;if(void 0!==o)for(var l=document.getElementsByTagName("script"),s=0;s<l.length;s++){var f=l[s];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+o){u=f;break}}u||(i=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,w.nc&&u.setAttribute("nonce",w.nc),u.setAttribute("data-webpack",r+o),u.src=t),e[t]=[n];var d=(r,n)=>{u.onerror=u.onload=null,clearTimeout(p);var o=e[t];if(delete e[t],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach((e=>e(n))),r)return r(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=d.bind(null,u.onerror),u.onload=d.bind(null,u.onload),i&&document.head.appendChild(u)}},w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{w.S={};var e={},r={};w.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];w.o(w.S,t)||(w.S[t]={});var a=w.S[t],u="@jupyter-server/resource-usage",i=(e,r,t,n)=>{var o=a[e]=a[e]||{},i=o[r];(!i||!i.loaded&&(!n!=!i.eager?n:u>i.from))&&(o[r]={get:t,from:u,eager:!!n})},l=[];return"default"===t&&(i("@jupyter-server/resource-usage","0.7.0",(()=>w.e(135).then((()=>()=>w(135))))),i("@lumino/polling","1.11.3",(()=>Promise.all([w.e(361),w.e(60)]).then((()=>()=>w(361))))),i("typestyle","2.4.0",(()=>w.e(114).then((()=>()=>w(114)))))),e[t]=l.length?Promise.all(l).then((()=>e[t]=1)):1}}})(),(()=>{var e;w.g.importScripts&&(e=w.g.location+"");var r=w.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),w.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var u=r[n],i=(typeof u)[0];if(a!=i)return"o"==a&&"n"==i||"s"==i||"u"==a;if("o"!=a&&"u"!=a&&o!=u)return o<u;n++}},o=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a<e.length;a++)n--,t+="u"==(typeof(i=e[a]))[0]?"-":(n>0?".":"")+(n=2,i);return t}var u=[];for(a=1;a<e.length;a++){var i=e[a];u.push(0===i?"not("+l()+")":1===i?"("+l()+" || "+l()+")":2===i?u.pop()+" "+u.pop():o(i))}return l();function l(){return u.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var u=0,i=1,l=!0;;i++,u++){var s,f,d=i<e.length?(typeof e[i])[0]:"";if(u>=r.length||"o"==(f=(typeof(s=r[u]))[0]))return!l||("u"==d?i>n&&!o:""==d!=o);if("u"==f){if(!l||"u"!=d)return!1}else if(l)if(d==f)if(i<=n){if(s!=e[i])return!1}else{if(o?s>e[i]:s<e[i])return!1;s!=e[i]&&(l=!1)}else if("s"!=d&&"n"!=d){if(o||i<=n)return!1;l=!1,i--}else{if(i<=n||f<d!=o)return!1;l=!1}else"s"!=d&&"n"!=d&&(l=!1,i--)}}var p=[],c=p.pop.bind(p);for(u=1;u<e.length;u++){var h=e[u];p.push(1==h?c()|c():2==h?c()&c():h?a(h,r):!c())}return!!c()},u=(e,r)=>{var t=w.S[e];if(!t||!w.o(t,r))throw new Error("Shared module "+r+" doesn't exist in shared scope "+e);return t},i=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&n(e,r)?r:e),0)},l=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",s=(e,r,t,n)=>{var o=i(e,t);return a(n,o)||"undefined"!=typeof console&&console.warn&&console.warn(l(e,t,o,n)),d(e[t][o])},f=(e,r,t)=>{var o=e[r];return(r=Object.keys(o).reduce(((e,r)=>!a(t,r)||e&&!n(e,r)?e:r),0))&&o[r]},d=e=>(e.loaded=1,e.get()),c=(p=e=>function(r,t,n,o){var a=w.I(r);return a&&a.then?a.then(e.bind(e,r,w.S[r],t,n,o)):e(r,w.S[r],t,n,o)})(((e,r,t,n)=>(u(e,t),s(r,0,t,n)))),h=p(((e,r,t,n,o)=>{var a=r&&w.o(r,t)&&f(r,t,n);return a?d(a):o()})),v={},g={15:()=>c("default","@jupyterlab/coreutils",[1,5,5,2]),134:()=>c("default","@jupyterlab/statusbar",[1,3,5,2]),142:()=>c("default","@jupyterlab/notebook",[1,3,5,2]),191:()=>c("default","@jupyterlab/translation",[1,3,5,2]),271:()=>c("default","react",[1,17,0,1]),305:()=>c("default","@jupyterlab/services",[1,6,5,2]),519:()=>h("default","typestyle",[1,2,4,0],(()=>w.e(114).then((()=>()=>w(114))))),544:()=>c("default","@jupyterlab/ui-components",[1,3,5,2]),722:()=>h("default","@lumino/polling",[1,1,11,3],(()=>Promise.all([w.e(361),w.e(60)]).then((()=>()=>w(361))))),740:()=>c("default","@jupyterlab/apputils",[1,3,5,2]),992:()=>c("default","@lumino/widgets",[1,1,33,0]),526:()=>c("default","@lumino/coreutils",[1,1,11,0]),840:()=>c("default","@lumino/signaling",[1,1,10,0])},b={60:[526,840],135:[15,134,142,191,271,305,519,544,722,740,992]},w.f.consumes=(e,r)=>{w.o(b,e)&&b[e].forEach((e=>{if(w.o(v,e))return r.push(v[e]);var t=r=>{v[e]=0,w.m[e]=t=>{delete w.c[e],t.exports=r()}},n=r=>{delete v[e],w.m[e]=t=>{throw delete w.c[e],r}};try{var o=g[e]();o.then?r.push(v[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={461:0};w.f.j=(r,t)=>{var n=w.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(60!=r){var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=w.p+w.u(r),u=new Error;w.l(a,(t=>{if(w.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;u.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",u.name="ChunkLoadError",u.type=o,u.request=a,n[1](u)}}),"chunk-"+r,r)}else e[r]=0};var r=(r,t)=>{var n,o,[a,u,i]=t,l=0;if(a.some((r=>0!==e[r]))){for(n in u)w.o(u,n)&&(w.m[n]=u[n]);i&&i(w)}for(r&&r(t);l<a.length;l++)o=a[l],w.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunk_jupyter_server_resource_usage=self.webpackChunk_jupyter_server_resource_usage||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),w.nc=void 0;var j=w(357);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter-server/resource-usage"]=j})(); |
+20
-2
@@ -5,2 +5,22 @@ # Changelog | ||
| ## 0.7.0 | ||
| ([Full Changelog](https://github.com/jupyter-server/jupyter-resource-usage/compare/@jupyter-server/resource-usage@0.6.4...861eafdd88aba1c2c405a3a1ade0bd376ac322ff)) | ||
| ### Enhancements made | ||
| - Add support for kernel usage [#164](https://github.com/jupyter-server/jupyter-resource-usage/pull/164) ([@davidbrochart](https://github.com/davidbrochart)) | ||
| ### Maintenance and upkeep improvements | ||
| - Bump loader-utils from 1.4.1 to 1.4.2 [#158](https://github.com/jupyter-server/jupyter-resource-usage/pull/158) ([@dependabot](https://github.com/dependabot)) | ||
| ### Contributors to this release | ||
| ([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter-resource-usage/graphs/contributors?from=2022-11-14&to=2023-01-06&type=c)) | ||
| [@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter-resource-usage+involves%3Adavidbrochart+updated%3A2022-11-14..2023-01-06&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter-resource-usage+involves%3Adependabot+updated%3A2022-11-14..2023-01-06&type=Issues) | [@jtpio](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter-resource-usage+involves%3Ajtpio+updated%3A2022-11-14..2023-01-06&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter-resource-usage+involves%3Akrassowski+updated%3A2022-11-14..2023-01-06&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter-resource-usage+involves%3Apre-commit-ci+updated%3A2022-11-14..2023-01-06&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter-resource-usage+involves%3Awelcome+updated%3A2022-11-14..2023-01-06&type=Issues) | ||
| <!-- <END NEW CHANGELOG ENTRY> --> | ||
| ## 0.6.4 | ||
@@ -21,4 +41,2 @@ | ||
| <!-- <END NEW CHANGELOG ENTRY> --> | ||
| ## 0.6.3 | ||
@@ -25,0 +43,0 @@ |
+1
-1
@@ -99,3 +99,3 @@ # Contributing | ||
| # go to the labextension directory | ||
| cd labextension/ | ||
| cd packages/labextension/ | ||
@@ -102,0 +102,0 @@ # Rebuild extension Typescript source after making changes |
| Metadata-Version: 2.1 | ||
| Name: jupyter-resource-usage | ||
| Version: 0.6.4 | ||
| Version: 0.7.0 | ||
| Summary: Jupyter Extension to show resource usage | ||
@@ -52,2 +52,5 @@ Home-page: https://github.com/jupyter-server/jupyter-resource-usage | ||
| Kernel resource usage can be displayed in a sidebar for IPython kernels with | ||
| [ipykernel](https://github.com/ipython/ipykernel) >= 6.11.0. | ||
| ## Installation | ||
@@ -70,5 +73,5 @@ | ||
| ``` | ||
| jupyter serverextension enable --py jupyter-resource-usage --sys-prefix | ||
| jupyter nbextension install --py jupyter-resource-usage --sys-prefix | ||
| jupyter nbextension enable --py jupyter-resource-usage --sys-prefix | ||
| jupyter serverextension enable --py jupyter_resource_usage --sys-prefix | ||
| jupyter nbextension install --py jupyter_resource_usage --sys-prefix | ||
| jupyter nbextension enable --py jupyter_resource_usage --sys-prefix | ||
| ``` | ||
@@ -75,0 +78,0 @@ |
@@ -1,2 +0,2 @@ | ||
| jupyter_server~=1.0 | ||
| jupyter_server>=1.0 | ||
| prometheus_client | ||
@@ -3,0 +3,0 @@ psutil~=5.6 |
@@ -30,6 +30,7 @@ CHANGELOG.md | ||
| jupyter_resource_usage/labextension/package.json | ||
| jupyter_resource_usage/labextension/static/114.b264be3cf7615fc9230a.js | ||
| jupyter_resource_usage/labextension/static/361.36fb85893b3381cfef43.js | ||
| jupyter_resource_usage/labextension/static/913.69720ef973b7f993d7e1.js | ||
| jupyter_resource_usage/labextension/static/remoteEntry.37849850391789894a58.js | ||
| jupyter_resource_usage/labextension/static/114.f007732a4d436149ea48.js | ||
| jupyter_resource_usage/labextension/static/135.7cb9ac4aa0ab3f972930.js | ||
| jupyter_resource_usage/labextension/static/361.fa4d5aead5d48c87a0d3.js | ||
| jupyter_resource_usage/labextension/static/643.bb8b6dae69fd08b5d52f.js | ||
| jupyter_resource_usage/labextension/static/remoteEntry.2f9a08fa2c9d98922863.js | ||
| jupyter_resource_usage/labextension/static/style.js | ||
@@ -36,0 +37,0 @@ jupyter_resource_usage/labextension/static/third-party-licenses.json |
| import json | ||
| import os.path as osp | ||
| from pathlib import Path | ||
@@ -7,6 +7,5 @@ from ._version import __version__ | ||
| HERE = osp.abspath(osp.dirname(__file__)) | ||
| HERE = Path(__file__).parent.resolve() | ||
| with open(osp.join(HERE, "labextension", "package.json")) as fid: | ||
| data = json.load(fid) | ||
| data = json.loads((HERE / "labextension" / "package.json").read_text()) | ||
@@ -13,0 +12,0 @@ |
@@ -1,1 +0,1 @@ | ||
| __version__ = "0.6.4" | ||
| __version__ = "0.7.0" |
@@ -5,3 +5,7 @@ import json | ||
| import psutil | ||
| import zmq | ||
| from jupyter_client.jsonutil import date_default | ||
| from jupyter_server.base.handlers import APIHandler | ||
| from jupyter_server.utils import url_path_join | ||
| from packaging import version | ||
| from tornado import web | ||
@@ -17,2 +21,12 @@ from tornado.concurrent import run_on_executor | ||
| try: | ||
| import ipykernel | ||
| USAGE_IS_SUPPORTED = version.parse("6.9.0") <= version.parse(ipykernel.__version__) | ||
| except ImportError: | ||
| USAGE_IS_SUPPORTED = False | ||
| MAX_RETRIES = 3 | ||
| class ApiHandler(APIHandler): | ||
@@ -79,1 +93,35 @@ executor = ThreadPoolExecutor(max_workers=5) | ||
| return sum([get_cpu_percent(p) for p in all_processes]) | ||
| class KernelUsageHandler(APIHandler): | ||
| @web.authenticated | ||
| async def get(self, matched_part=None, *args, **kwargs): | ||
| if not USAGE_IS_SUPPORTED: | ||
| self.write(json.dumps({})) | ||
| return | ||
| kernel_id = matched_part | ||
| km = self.kernel_manager | ||
| lkm = km.pinned_superclass.get_kernel(km, kernel_id) | ||
| session = lkm.session | ||
| client = lkm.client() | ||
| control_channel = client.control_channel | ||
| usage_request = session.msg("usage_request", {}) | ||
| control_channel.send(usage_request) | ||
| poller = zmq.Poller() | ||
| control_socket = control_channel.socket | ||
| poller.register(control_socket, zmq.POLLIN) | ||
| for i in range(1, MAX_RETRIES + 1): | ||
| timeout_ms = 1000 * i | ||
| events = dict(poller.poll(timeout_ms)) | ||
| if not events: | ||
| self.write(json.dumps({})) | ||
| break | ||
| if control_socket not in events: | ||
| continue | ||
| res = await client.control_channel.get_msg(timeout=0) | ||
| self.write(json.dumps(res, default=date_default)) | ||
| break |
| { | ||
| "name": "@jupyter-server/resource-usage", | ||
| "version": "0.6.4", | ||
| "version": "0.7.0", | ||
| "description": "JupyterLab extension to add resource usage UI items", | ||
@@ -22,2 +22,3 @@ "keywords": [ | ||
| "types": "lib/index.d.ts", | ||
| "style": "style/index.css", | ||
| "repository": { | ||
@@ -45,25 +46,52 @@ "type": "git", | ||
| "dependencies": { | ||
| "@jupyterlab/application": "^3.0.0", | ||
| "@jupyterlab/apputils": "^3.0.0", | ||
| "@jupyterlab/coreutils": "^5.0.0", | ||
| "@jupyterlab/services": "^6.0.0", | ||
| "@jupyterlab/statusbar": "^3.0.0", | ||
| "@jupyterlab/translation": "^3.0.0", | ||
| "@lumino/polling": "^1.3.3", | ||
| "typestyle": "^2.0.4" | ||
| "@jupyterlab/application": "^3.5.1", | ||
| "@jupyterlab/apputils": "^3.5.1", | ||
| "@jupyterlab/coreutils": "^5.5.1", | ||
| "@jupyterlab/notebook": "^3.5.1", | ||
| "@jupyterlab/services": "^6.5.1", | ||
| "@jupyterlab/statusbar": "^3.5.1", | ||
| "@jupyterlab/translation": "^3.5.1", | ||
| "@lumino/polling": "^1.11.3", | ||
| "typestyle": "^2.4.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@jupyterlab/builder": "^3.0.0", | ||
| "@jupyterlab/builder": "^3.5.1", | ||
| "@typescript-eslint/eslint-plugin": "^4.8.1", | ||
| "@typescript-eslint/parser": "^4.8.1", | ||
| "eslint": "^7.14.0", | ||
| "eslint-config-prettier": "^6.15.0", | ||
| "eslint-plugin-prettier": "^3.1.4", | ||
| "mkdirp": "^1.0.3", | ||
| "npm-run-all": "^4.1.5", | ||
| "prettier": "^2.1.1", | ||
| "rimraf": "^3.0.2", | ||
| "typescript": "~4.0.3" | ||
| "typescript": "~4.1.3" | ||
| }, | ||
| "sideEffects": [ | ||
| "style/*.css", | ||
| "style/index.js" | ||
| ], | ||
| "styleModule": "style/index.js", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "jupyterlab": { | ||
| "discovery": { | ||
| "server": { | ||
| "managers": [ | ||
| "pip" | ||
| ], | ||
| "base": { | ||
| "name": "jupyterlab_kernel_usage" | ||
| } | ||
| } | ||
| }, | ||
| "extension": true, | ||
| "outputDir": "../../jupyter_resource_usage/labextension", | ||
| "_build": { | ||
| "load": "static/remoteEntry.37849850391789894a58.js", | ||
| "extension": "./extension" | ||
| "load": "static/remoteEntry.2f9a08fa2c9d98922863.js", | ||
| "extension": "./extension", | ||
| "style": "./style" | ||
| } | ||
| } | ||
| } |
| /* This is a generated file of CSS imports */ | ||
| /* It was generated by @jupyterlab/builder in Build.ensureAssets() */ | ||
| import '@jupyter-server/resource-usage/style/index.js'; |
@@ -5,3 +5,3 @@ { | ||
| "name": "@lumino/polling", | ||
| "versionInfo": "1.9.1", | ||
| "versionInfo": "1.11.3", | ||
| "licenseId": "BSD-3-Clause", | ||
@@ -11,2 +11,8 @@ "extractedText": "" | ||
| { | ||
| "name": "css-loader", | ||
| "versionInfo": "5.2.7", | ||
| "licenseId": "MIT", | ||
| "extractedText": "Copyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n" | ||
| }, | ||
| { | ||
| "name": "free-style", | ||
@@ -18,4 +24,10 @@ "versionInfo": "3.1.0", | ||
| { | ||
| "name": "style-loader", | ||
| "versionInfo": "2.0.0", | ||
| "licenseId": "MIT", | ||
| "extractedText": "Copyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n" | ||
| }, | ||
| { | ||
| "name": "typestyle", | ||
| "versionInfo": "2.2.0", | ||
| "versionInfo": "2.4.0", | ||
| "licenseId": "MIT", | ||
@@ -22,0 +34,0 @@ "extractedText": "MIT License\n\nCopyright (c) 2016 typestyle\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n" |
@@ -5,2 +5,3 @@ from jupyter_server.utils import url_path_join | ||
| from jupyter_resource_usage.api import ApiHandler | ||
| from jupyter_resource_usage.api import KernelUsageHandler | ||
| from jupyter_resource_usage.config import ResourceUseDisplay | ||
@@ -22,2 +23,13 @@ from jupyter_resource_usage.metrics import PSUtilMetricsLoader | ||
| ) | ||
| server_app.web_app.add_handlers( | ||
| ".*$", | ||
| [ | ||
| ( | ||
| url_path_join( | ||
| base_url, "/api/metrics/v1/kernel_usage", r"get_usage/(.+)$" | ||
| ), | ||
| KernelUsageHandler, | ||
| ) | ||
| ], | ||
| ) | ||
@@ -24,0 +36,0 @@ if resuseconfig.enable_prometheus_metrics: |
+7
-4
| Metadata-Version: 2.1 | ||
| Name: jupyter-resource-usage | ||
| Version: 0.6.4 | ||
| Version: 0.7.0 | ||
| Summary: Jupyter Extension to show resource usage | ||
@@ -52,2 +52,5 @@ Home-page: https://github.com/jupyter-server/jupyter-resource-usage | ||
| Kernel resource usage can be displayed in a sidebar for IPython kernels with | ||
| [ipykernel](https://github.com/ipython/ipykernel) >= 6.11.0. | ||
| ## Installation | ||
@@ -70,5 +73,5 @@ | ||
| ``` | ||
| jupyter serverextension enable --py jupyter-resource-usage --sys-prefix | ||
| jupyter nbextension install --py jupyter-resource-usage --sys-prefix | ||
| jupyter nbextension enable --py jupyter-resource-usage --sys-prefix | ||
| jupyter serverextension enable --py jupyter_resource_usage --sys-prefix | ||
| jupyter nbextension install --py jupyter_resource_usage --sys-prefix | ||
| jupyter nbextension enable --py jupyter_resource_usage --sys-prefix | ||
| ``` | ||
@@ -75,0 +78,0 @@ |
+1
-1
@@ -22,3 +22,3 @@ [build-system] | ||
| [tool.tbump.version] | ||
| current = "0.6.4" | ||
| current = "0.7.0" | ||
| regex = ''' | ||
@@ -25,0 +25,0 @@ (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+) |
+6
-3
@@ -22,2 +22,5 @@ **[Installation](#installation)** | | ||
| Kernel resource usage can be displayed in a sidebar for IPython kernels with | ||
| [ipykernel](https://github.com/ipython/ipykernel) >= 6.11.0. | ||
| ## Installation | ||
@@ -40,5 +43,5 @@ | ||
| ``` | ||
| jupyter serverextension enable --py jupyter-resource-usage --sys-prefix | ||
| jupyter nbextension install --py jupyter-resource-usage --sys-prefix | ||
| jupyter nbextension enable --py jupyter-resource-usage --sys-prefix | ||
| jupyter serverextension enable --py jupyter_resource_usage --sys-prefix | ||
| jupyter nbextension install --py jupyter_resource_usage --sys-prefix | ||
| jupyter nbextension enable --py jupyter_resource_usage --sys-prefix | ||
| ``` | ||
@@ -45,0 +48,0 @@ |
+1
-1
@@ -46,3 +46,3 @@ [flake8] | ||
| install_requires = | ||
| jupyter_server~=1.0 | ||
| jupyter_server>=1.0 | ||
| prometheus_client | ||
@@ -49,0 +49,0 @@ psutil~=5.6 |
| (self.webpackChunk_jupyter_server_resource_usage=self.webpackChunk_jupyter_server_resource_usage||[]).push([[114],{114:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TypeStyle:()=>C,classes:()=>$,createTypeStyle:()=>W,cssRaw:()=>A,cssRule:()=>O,extend:()=>x,fontFace:()=>F,forceRenderStyles:()=>U,getStyles:()=>q,keyframes:()=>N,media:()=>b,reinit:()=>H,setStylesTarget:()=>T,style:()=>G,stylesheet:()=>z,types:()=>I});let s=0;const r=Object.create(null),i=["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","columns","counter-increment","counter-reset","flex","flex-grow","flex-positive","flex-shrink","flex-negative","flex-order","font-weight","grid-area","grid-column","grid-column-end","grid-column-span","grid-column-start","grid-row","grid-row-end","grid-row-span","grid-row-start","line-clamp","line-height","opacity","order","orphans","tab-size","widows","z-index","zoom","fill-opacity","flood-opacity","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width"];for(const e of i)for(const t of["-webkit-","-ms-","-moz-","-o-",""])r[t+e]=!0;function o(e,t){return t&&"number"==typeof t&&!r[e]?`${e}:${t}px`:`${e}:${t}`}function a(e){return e.sort(((e,t)=>e[0]>t[0]?1:-1))}function h(e){return e.map((([e,t])=>Array.isArray(t)?t.map((t=>o(e,t))).join(";"):o(e,t))).join(";")}function c(e,t){return-1===e.indexOf("&")?`${t} ${e}`:e.replace(/&/g,t)}function l(e,t,n,s,r){const{style:i,nested:o,isUnique:u}=function(e,t){const n=[],s=[];for(const t of Object.keys(e)){const i=t.trim(),o=e[t];36!==i.charCodeAt(0)&&null!=o&&("object"!=typeof o||Array.isArray(o)?n.push([(r=i,r.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)).replace(/^ms-/,"-ms-")),o]):s.push([i,o]))}var r;return{style:h(a(n)),nested:t?s:a(s),isUnique:!!e.$unique}}(t,""!==e);let d=i;if(64===e.charCodeAt(0)){const t={selector:e,styles:[],rules:[],style:r?"":i};n.push(t),i&&r&&t.styles.push({selector:r,style:i,isUnique:u});for(const[e,n]of o)d+=e+l(e,n,t.rules,t.styles,r)}else{const t=r?c(e,r):e;i&&s.push({selector:t,style:i,isUnique:u});for(const[e,r]of o)d+=e+l(e,r,n,s,t)}return d}function u(e,t,n,r,i,o){for(const{selector:n,style:a,isUnique:h}of r){const r=o?c(n,i):n,l=h?`u\0${(++s).toString(36)}`:`s\0${t}\0${a}`,u=new p(a,l);u.add(new y(r,`k\0${t}\0${r}`)),e.add(u)}for(const{selector:s,style:r,rules:a,styles:h}of n){const n=new m(s,r,`r\0${t}\0${s}\0${r}`);u(n,t,a,h,i,o),e.add(n)}}function d(e){let t="";for(let n=0;n<e.length;n++)t+=e[n];return t}const f={add:()=>{},change:()=>{},remove:()=>{}};class g{constructor(e=f){this.changes=e,this.sheet=[],this.changeId=0,this._keys=[],this._children=Object.create(null),this._counters=Object.create(null)}add(e){const t=this._counters[e.id]||0,n=this._children[e.id]||e.clone();if(this._counters[e.id]=t+1,0===t)this._children[n.id]=n,this._keys.push(n.id),this.sheet.push(n.getStyles()),this.changeId++,this.changes.add(n,this._keys.length-1);else if(n instanceof g&&e instanceof g){const t=this._keys.indexOf(e.id),s=n.changeId;n.merge(e),n.changeId!==s&&(this.sheet.splice(t,1,n.getStyles()),this.changeId++,this.changes.change(n,t,t))}}remove(e){const t=this._counters[e.id];if(t){this._counters[e.id]=t-1;const n=this._children[e.id],s=this._keys.indexOf(n.id);if(1===t)delete this._counters[e.id],delete this._children[e.id],this._keys.splice(s,1),this.sheet.splice(s,1),this.changeId++,this.changes.remove(n,s);else if(n instanceof g&&e instanceof g){const t=n.changeId;n.unmerge(e),n.changeId!==t&&(this.sheet.splice(s,1,n.getStyles()),this.changeId++,this.changes.change(n,s,s))}}}values(){return this._keys.map((e=>this._children[e]))}merge(e){for(const t of e.values())this.add(t);return this}unmerge(e){for(const t of e.values())this.remove(t);return this}clone(){return(new g).merge(this)}}class y{constructor(e,t){this.selector=e,this.id=t}getStyles(){return this.selector}clone(){return this}}class p extends g{constructor(e,t){super(),this.style=e,this.id=t}getStyles(){return`${this.sheet.join(",")}{${this.style}}`}clone(){return new p(this.style,this.id).merge(this)}}class m extends g{constructor(e,t,n){super(),this.rule=e,this.style=t,this.id=n}getStyles(){return`${this.rule}{${this.style}${d(this.sheet)}}`}clone(){return new m(this.rule,this.style,this.id).merge(this)}}function _(e,t){return`f${function(e){let t=5381,n=e.length;for(;n--;)t=33*t^e.charCodeAt(n);return(t>>>0).toString(36)}(e)}`}class v extends g{constructor(e,t){super(t),this.id=e}registerStyle(e){const t=[],n=[],s=l("&",e,t,n),r=_(s);return u(this,s,t,n,`.${r}`,!0),r}registerKeyframes(e){return this.registerHashRule("@keyframes",e)}registerHashRule(e,t){const n=[],s=[],r=l("",t,n,s),i=_(r),o=new m(`${e} ${i}`,"",`h\0${r}\0${e}`);return u(o,r,n,s,"",!1),this.add(o),i}registerRule(e,t){const n=[],s=[];u(this,l(e,t,n,s),n,s,"",!1)}registerCss(e){return this.registerRule("",e)}getStyles(){return d(this.sheet)}clone(){return new v(this.id,this.changes).merge(this)}}function w(e){var t={};for(var n in e){var s=e[n];if("$nest"===n){var r=s;for(var i in r){var o=r[i];t[i]=w(o)}}else"$debugName"===n?t.$displayName=s:t[n]=s}return t}var S="undefined"==typeof requestAnimationFrame?function(e){return setTimeout(e)}:"undefined"==typeof window?requestAnimationFrame:requestAnimationFrame.bind(window);function $(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map((function(e){return e&&"object"==typeof e?Object.keys(e).map((function(t){return!!e[t]&&t})):[e]})).reduce((function(e,t){return e.concat(t)}),[]).filter((function(e){return!!e})).join(" ")}function x(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},s=0,r=e;s<r.length;s++){var i=r[s];if(null!=i&&!1!==i)for(var o in i){var a=i[o];(a||0===a)&&("$nest"===o&&a?n[o]=n.$nest?x(n.$nest,a):a:-1!==o.indexOf("&")||0===o.indexOf("@media")?n[o]=n[o]?x(n[o],a):a:n[o]=a)}}return n}var b=function(e){for(var t,n=[],s=1;s<arguments.length;s++)n[s-1]=arguments[s];var r=[];e.type&&r.push(e.type),e.orientation&&r.push("(orientation: "+e.orientation+")"),e.minWidth&&r.push("(min-width: "+k(e.minWidth)+")"),e.maxWidth&&r.push("(max-width: "+k(e.maxWidth)+")"),e.minHeight&&r.push("(min-height: "+k(e.minHeight)+")"),e.maxHeight&&r.push("(max-height: "+k(e.maxHeight)+")");var i="@media "+r.join(" and "),o={$nest:(t={},t[i]=x.apply(void 0,n),t)};return o},k=function(e){return"string"==typeof e?e:e+"px"},R=function(){return new v(`f${(++s).toString(36)}`,undefined)},C=function(){function e(e){var t=this,n=e.autoGenerateTag;this.cssRaw=function(e){e&&(t._raw+=e||"",t._pendingRawChange=!0,t._styleUpdated())},this.cssRule=function(e){for(var n=[],s=1;s<arguments.length;s++)n[s-1]=arguments[s];var r=w(x.apply(void 0,n));t._freeStyle.registerRule(e,r),t._styleUpdated()},this.forceRenderStyles=function(){var e=t._getTag();e&&(e.textContent=t.getStyles())},this.fontFace=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var s=t._freeStyle,r=0,i=e;r<i.length;r++){var o=i[r];s.registerRule("@font-face",o)}t._styleUpdated()},this.getStyles=function(){return(t._raw||"")+t._freeStyle.getStyles()},this.keyframes=function(e){var n=function(e){var t={};for(var n in e)"$debugName"!==n&&(t[n]=e[n]);return e.$debugName&&(t.$displayName=e.$debugName),t}(e),s=t._freeStyle.registerKeyframes(n);return t._styleUpdated(),s},this.reinit=function(){var e=R();t._freeStyle=e,t._lastFreeStyleChangeId=e.changeId,t._raw="",t._pendingRawChange=!1;var n=t._getTag();n&&(n.textContent="")},this.setStylesTarget=function(e){t._tag&&(t._tag.textContent=""),t._tag=e,t.forceRenderStyles()},this.stylesheet=function(e){for(var n={},s=0,r=Object.getOwnPropertyNames(e);s<r.length;s++){var i=r[s],o=e[i];o&&(o.$debugName=i,n[i]=t.style(o))}return n};var s=R();this._autoGenerateTag=n,this._freeStyle=s,this._lastFreeStyleChangeId=s.changeId,this._pending=0,this._pendingRawChange=!1,this._raw="",this._tag=void 0,this.style=this.style.bind(this)}return e.prototype._afterAllSync=function(e){var t=this;this._pending++;var n=this._pending;S((function(){n===t._pending&&e()}))},e.prototype._getTag=function(){if(this._tag)return this._tag;if(this._autoGenerateTag){var e="undefined"==typeof window?{textContent:""}:document.createElement("style");return"undefined"!=typeof document&&document.head.appendChild(e),this._tag=e,e}},e.prototype._styleUpdated=function(){var e=this,t=this._freeStyle.changeId,n=this._lastFreeStyleChangeId;(this._pendingRawChange||t!==n)&&(this._lastFreeStyleChangeId=t,this._pendingRawChange=!1,this._afterAllSync((function(){return e.forceRenderStyles()})))},e.prototype.style=function(){var e=this._freeStyle.registerStyle(w(x.apply(void 0,arguments)));return this._styleUpdated(),e},e}(),I=n(724),j=new C({autoGenerateTag:!0}),T=j.setStylesTarget,A=j.cssRaw,O=j.cssRule,U=j.forceRenderStyles,F=j.fontFace,q=j.getStyles,N=j.keyframes,H=j.reinit,G=j.style,z=j.stylesheet;function W(e){var t=new C({autoGenerateTag:!1});return e&&t.setStylesTarget(e),t}},724:()=>{}}]); |
| "use strict";(self.webpackChunk_jupyter_server_resource_usage=self.webpackChunk_jupyter_server_resource_usage||[]).push([[361],{361:(e,t,n)=>{n.r(t),n.d(t,{Debouncer:()=>y,Poll:()=>f,RateLimiter:()=>d,Throttler:()=>m});var i=n(526),r=n(840),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};function u(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}function c(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var l,p="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate,h="function"==typeof cancelAnimationFrame?cancelAnimationFrame:clearImmediate,f=function(){function e(e){var t=this;this._disposed=new r.Signal(this),this._tick=new i.PromiseDelegate,this._ticked=new r.Signal(this),this._timeout=-1,this._factory=e.factory,this._standby=e.standby||l.DEFAULT_STANDBY,this._state=a(a({},l.DEFAULT_STATE),{timestamp:(new Date).getTime()});var n=e.frequency||{},o=Math.max(n.interval||0,n.max||0,l.DEFAULT_FREQUENCY.max);this.frequency=a(a(a({},l.DEFAULT_FREQUENCY),n),{max:o}),this.name=e.name||l.DEFAULT_NAME,"auto"in e&&!e.auto||p((function(){t.start()}))}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frequency",{get:function(){return this._frequency},set:function(t){if(!this.isDisposed&&!i.JSONExt.deepEqual(t,this.frequency||{})){var n=t.backoff,r=t.interval,o=t.max;if(r=Math.round(r),o=Math.round(o),"number"==typeof n&&n<1)throw new Error("Poll backoff growth factor must be at least 1");if((r<0||r>o)&&r!==e.NEVER)throw new Error("Poll interval must be between 0 and max");if(o>e.MAX_INTERVAL&&o!==e.NEVER)throw new Error("Max interval must be less than "+e.MAX_INTERVAL);this._frequency={backoff:n,interval:r,max:o}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return"disposed"===this.state.phase},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"standby",{get:function(){return this._standby},set:function(e){this.isDisposed||this.standby===e||(this._standby=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tick",{get:function(){return this._tick.promise},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ticked",{get:function(){return this._ticked},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this._state=a(a({},l.DISPOSED_STATE),{timestamp:(new Date).getTime()}),this._tick.promise.catch((function(e){})),this._tick.reject(new Error("Poll ("+this.name+") is disposed.")),this._disposed.emit(void 0),r.Signal.clearData(this))},e.prototype.refresh=function(){return this.schedule({cancel:function(e){return"refreshed"===e.phase},interval:e.IMMEDIATE,phase:"refreshed"})},e.prototype.schedule=function(t){return void 0===t&&(t={}),u(this,void 0,void 0,(function(){var n,r,o,s,u,l=this;return c(this,(function(c){switch(c.label){case 0:return this.isDisposed||t.cancel&&t.cancel(this.state)?[2]:(n=this.state,r=this._tick,o=new i.PromiseDelegate,s=a({interval:this.frequency.interval,payload:null,phase:"standby",timestamp:(new Date).getTime()},t),this._state=s,this._tick=o,n.interval===e.IMMEDIATE?h(this._timeout):clearTimeout(this._timeout),this._ticked.emit(this.state),r.resolve(this),[4,r.promise]);case 1:return c.sent(),u=function(){l.isDisposed||l.tick!==o.promise||l._execute()},this._timeout=s.interval===e.IMMEDIATE?p(u):s.interval===e.NEVER?-1:setTimeout(u,s.interval),[2]}}))}))},e.prototype.start=function(){return this.schedule({cancel:function(e){var t=e.phase;return"constructed"!==t&&"standby"!==t&&"stopped"!==t},interval:e.IMMEDIATE,phase:"started"})},e.prototype.stop=function(){return this.schedule({cancel:function(e){return"stopped"===e.phase},interval:e.NEVER,phase:"stopped"})},e.prototype._execute=function(){var e=this,t="function"==typeof this.standby?this.standby():this.standby;if(t="never"!==t&&("when-hidden"===t?!("undefined"==typeof document||!document||!document.hidden):t))this.schedule();else{var n=this.tick;this._factory(this.state).then((function(t){e.isDisposed||e.tick!==n||e.schedule({payload:t,phase:"rejected"===e.state.phase?"reconnected":"resolved"})})).catch((function(t){e.isDisposed||e.tick!==n||e.schedule({interval:l.sleep(e.frequency,e.state),payload:t,phase:"rejected"})}))}},e}();!function(e){e.IMMEDIATE=0,e.MAX_INTERVAL=2147483647,e.NEVER=1/0}(f||(f={})),function(e){e.DEFAULT_BACKOFF=3,e.DEFAULT_FREQUENCY={backoff:!0,interval:1e3,max:3e4},e.DEFAULT_NAME="unknown",e.DEFAULT_STANDBY="when-hidden",e.DEFAULT_STATE={interval:f.NEVER,payload:null,phase:"constructed",timestamp:new Date(0).getTime()},e.DISPOSED_STATE={interval:f.NEVER,payload:null,phase:"disposed",timestamp:new Date(0).getTime()},e.sleep=function(t,n){var i=t.backoff,r=t.interval,o=t.max;if(r===f.NEVER)return r;var s=!0===i?e.DEFAULT_BACKOFF:!1===i?1:i,a=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}(r,n.interval*s);return Math.min(o,a)}}(l||(l={}));var d=function(){function e(e,t){var n=this;void 0===t&&(t=500),this.payload=null,this.limit=t,this.poll=new f({auto:!1,factory:function(){return u(n,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:return[4,e()];case 1:return[2,t.sent()]}}))}))},frequency:{backoff:!1,interval:f.NEVER,max:f.NEVER},standby:"never"}),this.payload=new i.PromiseDelegate,this.poll.ticked.connect((function(e,t){var r=n.payload;return"resolved"===t.phase?(n.payload=new i.PromiseDelegate,void r.resolve(t.payload)):"rejected"===t.phase||"stopped"===t.phase?(n.payload=new i.PromiseDelegate,r.promise.catch((function(e){})),void r.reject(t.payload)):void 0}),this)}return Object.defineProperty(e.prototype,"isDisposed",{get:function(){return null===this.payload},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this.payload=null,this.poll.dispose())},e.prototype.stop=function(){return u(this,void 0,void 0,(function(){return c(this,(function(e){return[2,this.poll.stop()]}))}))},e}(),y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.invoke=function(){return this.poll.schedule({interval:this.limit,phase:"invoked"}),this.payload.promise},t}(d),m=function(e){function t(t,n){var i=e.call(this,t,"number"==typeof n?n:n&&n.limit)||this,r="leading";return"number"!=typeof n&&(r="edge"in(n=n||{})?n.edge:r),i._interval="trailing"===r?i.limit:f.IMMEDIATE,i}return s(t,e),t.prototype.invoke=function(){return"invoked"!==this.poll.state.phase&&this.poll.schedule({interval:this._interval,phase:"invoked"}),this.payload.promise},t}(d)}}]); |
| "use strict";(self.webpackChunk_jupyter_server_resource_usage=self.webpackChunk_jupyter_server_resource_usage||[]).push([[913],{913:(t,e,r)=>{r.r(e),r.d(e,{default:()=>I});var s=r(436),i=r(856),n=r(169),a=r(19),o=r(579),m=r(598),l=r(271),_=r.n(l);const u=(0,r(632).style)({fontSize:"var(--jp-ui-font-size1)",fontFamily:"var(--jp-ui-font-family)"},{backgroundColor:"#FFD2D2",color:"#D8000C"});class M extends n.VDomRenderer{constructor(t){super(new M.Model({refreshRate:5e3})),this.translator=t||i.nullTranslator,this._trans=this.translator.load("jupyterlab")}render(){if(!this.model)return _().createElement("div",null);let t;return t=null===this.model.memoryLimit?this._trans.__("Mem: %1 %2",this.model.currentMemory.toFixed(c.DECIMAL_PLACES),this.model.units):this._trans.__("Mem: %1 / %2 %3",this.model.currentMemory.toFixed(c.DECIMAL_PLACES),this.model.memoryLimit.toFixed(c.DECIMAL_PLACES),this.model.units),this.model.usageWarning?_().createElement(s.TextItem,{title:this._trans.__("Current memory usage"),source:t,className:u}):_().createElement(s.TextItem,{title:this._trans.__("Current memory usage"),source:t})}}var c;!function(t){class e extends n.VDomModel{constructor(t){super(),this._currentMemory=0,this._memoryLimit=null,this._metricsAvailable=!1,this._units="B",this._warn=!1,this._poll=new m.Poll({factory:()=>c.factory(),frequency:{interval:t.refreshRate,backoff:!0},name:"@jupyterlab/statusbar:MemoryUsage#metrics"}),this._poll.ticked.connect((t=>{const{payload:e,phase:r}=t.state;if("resolved"!==r){if("rejected"===r){const t=this._metricsAvailable;return this._metricsAvailable=!1,this._currentMemory=0,this._memoryLimit=null,this._units="B",void(t&&this.stateChanged.emit())}}else this._updateMetricsValues(e)}))}get metricsAvailable(){return this._metricsAvailable}get currentMemory(){return this._currentMemory}get memoryLimit(){return this._memoryLimit}get units(){return this._units}get usageWarning(){return this._warn}dispose(){super.dispose(),this._poll.dispose()}_updateMetricsValues(t){const e=this._metricsAvailable,r=this._currentMemory,s=this._memoryLimit,i=this._units,n=this._warn;if(null===t)this._metricsAvailable=!1,this._currentMemory=0,this._memoryLimit=null,this._units="B",this._warn=!1;else{const e=t.rss,r=t.limits.memory?t.limits.memory.rss:null,[s,i]=c.convertToLargestUnit(e),n=!!t.limits.memory&&t.limits.memory.warn;this._metricsAvailable=!0,this._currentMemory=s,this._units=i,this._memoryLimit=r?r/c.MEMORY_UNIT_LIMITS[i]:null,this._warn=n}this._currentMemory===r&&this._units===i&&this._memoryLimit===s&&this._metricsAvailable===e&&this._warn===n||this.stateChanged.emit(void 0)}}t.Model=e}(M||(M={})),function(t){t.DECIMAL_PLACES=2,t.MEMORY_UNIT_LIMITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776,PB:0x4000000000000},t.convertToLargestUnit=function(e){return e<t.MEMORY_UNIT_LIMITS.KB?[e,"B"]:t.MEMORY_UNIT_LIMITS.KB===e||e<t.MEMORY_UNIT_LIMITS.MB?[e/t.MEMORY_UNIT_LIMITS.KB,"KB"]:t.MEMORY_UNIT_LIMITS.MB===e||e<t.MEMORY_UNIT_LIMITS.GB?[e/t.MEMORY_UNIT_LIMITS.MB,"MB"]:t.MEMORY_UNIT_LIMITS.GB===e||e<t.MEMORY_UNIT_LIMITS.TB?[e/t.MEMORY_UNIT_LIMITS.GB,"GB"]:t.MEMORY_UNIT_LIMITS.TB===e||e<t.MEMORY_UNIT_LIMITS.PB?[e/t.MEMORY_UNIT_LIMITS.TB,"TB"]:[e/t.MEMORY_UNIT_LIMITS.PB,"PB"]};const e=o.ServerConnection.makeSettings(),r=a.URLExt.join(e.baseUrl,"api/metrics/v1");t.factory=async function(){const t=o.ServerConnection.makeRequest(r,{},e),s=await t;return await s.json()}}(c||(c={}));const h={id:"@jupyter-server/resource-usage:memory-status-item",autoStart:!0,requires:[s.IStatusBar,i.ITranslator],activate:(t,e,r)=>{const s=new M(r);e.registerStatusItem(h.id,{item:s,align:"left",rank:2,isActive:()=>s.model.metricsAvailable,activeStateChanged:s.model.stateChanged})}},I=h}}]); |
| var _JUPYTERLAB;(()=>{"use strict";var e,r,t,n,o,a,u,i,l,s,f,d,c,p,h,v,g,b,y={543:(e,r,t)=>{var n={"./index":()=>t.e(913).then((()=>()=>t(913))),"./extension":()=>t.e(913).then((()=>()=>t(913)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n=t.S.default,o="default";if(n&&n!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[o]=e,t.I(o,r)}};t.d(r,{get:()=>o,init:()=>a})}},m={};function w(e){var r=m[e];if(void 0!==r)return r.exports;var t=m[e]={exports:{}};return y[e](t,t.exports,w),t.exports}w.m=y,w.c=m,w.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return w.d(r,{a:r}),r},w.d=(e,r)=>{for(var t in r)w.o(r,t)&&!w.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},w.f={},w.e=e=>Promise.all(Object.keys(w.f).reduce(((r,t)=>(w.f[t](e,r),r)),[])),w.u=e=>e+"."+{60:"1463f33f6e8ff0803e8f",114:"b264be3cf7615fc9230a",361:"36fb85893b3381cfef43",913:"69720ef973b7f993d7e1"}[e]+".js?v="+{60:"1463f33f6e8ff0803e8f",114:"b264be3cf7615fc9230a",361:"36fb85893b3381cfef43",913:"69720ef973b7f993d7e1"}[e],w.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),w.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@jupyter-server/resource-usage:",w.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var u,i;if(void 0!==o)for(var l=document.getElementsByTagName("script"),s=0;s<l.length;s++){var f=l[s];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+o){u=f;break}}u||(i=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,w.nc&&u.setAttribute("nonce",w.nc),u.setAttribute("data-webpack",r+o),u.src=t),e[t]=[n];var d=(r,n)=>{u.onerror=u.onload=null,clearTimeout(c);var o=e[t];if(delete e[t],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach((e=>e(n))),r)return r(n)},c=setTimeout(d.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=d.bind(null,u.onerror),u.onload=d.bind(null,u.onload),i&&document.head.appendChild(u)}},w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{w.S={};var e={},r={};w.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];w.o(w.S,t)||(w.S[t]={});var a=w.S[t],u="@jupyter-server/resource-usage",i=(e,r,t,n)=>{var o=a[e]=a[e]||{},i=o[r];(!i||!i.loaded&&(!n!=!i.eager?n:u>i.from))&&(o[r]={get:t,from:u,eager:!!n})},l=[];return"default"===t&&(i("@jupyter-server/resource-usage","0.6.4",(()=>w.e(913).then((()=>()=>w(913))))),i("@lumino/polling","1.9.1",(()=>Promise.all([w.e(361),w.e(60)]).then((()=>()=>w(361))))),i("typestyle","2.2.0",(()=>w.e(114).then((()=>()=>w(114)))))),e[t]=l.length?Promise.all(l).then((()=>e[t]=1)):1}}})(),(()=>{var e;w.g.importScripts&&(e=w.g.location+"");var r=w.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),w.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var u=r[n],i=(typeof u)[0];if(a!=i)return"o"==a&&"n"==i||"s"==i||"u"==a;if("o"!=a&&"u"!=a&&o!=u)return o<u;n++}},o=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a<e.length;a++)n--,t+="u"==(typeof(i=e[a]))[0]?"-":(n>0?".":"")+(n=2,i);return t}var u=[];for(a=1;a<e.length;a++){var i=e[a];u.push(0===i?"not("+l()+")":1===i?"("+l()+" || "+l()+")":2===i?u.pop()+" "+u.pop():o(i))}return l();function l(){return u.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var u=0,i=1,l=!0;;i++,u++){var s,f,d=i<e.length?(typeof e[i])[0]:"";if(u>=r.length||"o"==(f=(typeof(s=r[u]))[0]))return!l||("u"==d?i>n&&!o:""==d!=o);if("u"==f){if(!l||"u"!=d)return!1}else if(l)if(d==f)if(i<=n){if(s!=e[i])return!1}else{if(o?s>e[i]:s<e[i])return!1;s!=e[i]&&(l=!1)}else if("s"!=d&&"n"!=d){if(o||i<=n)return!1;l=!1,i--}else{if(i<=n||f<d!=o)return!1;l=!1}else"s"!=d&&"n"!=d&&(l=!1,i--)}}var c=[],p=c.pop.bind(c);for(u=1;u<e.length;u++){var h=e[u];c.push(1==h?p()|p():2==h?p()&p():h?a(h,r):!p())}return!!p()},u=(e,r)=>{var t=w.S[e];if(!t||!w.o(t,r))throw new Error("Shared module "+r+" doesn't exist in shared scope "+e);return t},i=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&n(e,r)?r:e),0)},l=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",s=(e,r,t,n)=>{var o=i(e,t);return a(n,o)||"undefined"!=typeof console&&console.warn&&console.warn(l(e,t,o,n)),d(e[t][o])},f=(e,r,t)=>{var o=e[r];return(r=Object.keys(o).reduce(((e,r)=>!a(t,r)||e&&!n(e,r)?e:r),0))&&o[r]},d=e=>(e.loaded=1,e.get()),p=(c=e=>function(r,t,n,o){var a=w.I(r);return a&&a.then?a.then(e.bind(e,r,w.S[r],t,n,o)):e(r,w.S[r],t,n,o)})(((e,r,t,n)=>(u(e,t),s(r,0,t,n)))),h=c(((e,r,t,n,o)=>{var a=r&&w.o(r,t)&&f(r,t,n);return a?d(a):o()})),v={},g={19:()=>p("default","@jupyterlab/coreutils",[1,5,5,0]),169:()=>p("default","@jupyterlab/apputils",[1,3,5,0]),271:()=>p("default","react",[1,17,0,1]),436:()=>p("default","@jupyterlab/statusbar",[1,3,5,0]),579:()=>p("default","@jupyterlab/services",[1,6,5,0]),598:()=>h("default","@lumino/polling",[1,1,3,3],(()=>Promise.all([w.e(361),w.e(60)]).then((()=>()=>w(361))))),632:()=>h("default","typestyle",[1,2,0,4],(()=>w.e(114).then((()=>()=>w(114))))),856:()=>p("default","@jupyterlab/translation",[1,3,5,0]),526:()=>p("default","@lumino/coreutils",[1,1,11,0]),840:()=>p("default","@lumino/signaling",[1,1,10,0])},b={60:[526,840],913:[19,169,271,436,579,598,632,856]},w.f.consumes=(e,r)=>{w.o(b,e)&&b[e].forEach((e=>{if(w.o(v,e))return r.push(v[e]);var t=r=>{v[e]=0,w.m[e]=t=>{delete w.c[e],t.exports=r()}},n=r=>{delete v[e],w.m[e]=t=>{throw delete w.c[e],r}};try{var o=g[e]();o.then?r.push(v[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={461:0};w.f.j=(r,t)=>{var n=w.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(60!=r){var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=w.p+w.u(r),u=new Error;w.l(a,(t=>{if(w.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;u.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",u.name="ChunkLoadError",u.type=o,u.request=a,n[1](u)}}),"chunk-"+r,r)}else e[r]=0};var r=(r,t)=>{var n,o,[a,u,i]=t,l=0;if(a.some((r=>0!==e[r]))){for(n in u)w.o(u,n)&&(w.m[n]=u[n]);i&&i(w)}for(r&&r(t);l<a.length;l++)o=a[l],w.o(e,o)&&e[o]&&e[o][0](),e[a[l]]=0},t=self.webpackChunk_jupyter_server_resource_usage=self.webpackChunk_jupyter_server_resource_usage||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var j=w(543);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter-server/resource-usage"]=j})(); |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
121734
18.06%40
2.56%673
11.24%