All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.1255d548-5967.db64ad8f30f8fbf32c94.js Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-5967"],{nKnTKuph:(G,b,c)=>{c.d(b,{qb:()=>K,jb:()=>j,CL:()=>L,qC:()=>Z,Po:()=>le,vn:()=>B,Jt:()=>ue});var T=c("ii0bleBb"),a=c.n(T),e=c("Z7aTuO5B"),v=c("9pdI12pI"),l=c.n(v),o=c("5NVsf39r"),y=Object.defineProperty,m=(t,r,n)=>r in t?y(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,f=(t,r,n)=>(m(t,typeof r!="symbol"?r+"":r,n),n);class M extends e.Component{constructor(){super(...arguments),f(this,"state",{prevMetric:null,prevTs:null,nowTs:o.Z.nowInSeconds()}),f(this,"_checkPrevMetric",()=>this.state.prevMetric&&this.state.prevMetric.count!==void 0&&this.state.prevTs),f(this,"_placeholder",()=>this.props.hideOnZero?null:e.createElement("span",null,this._prefix(),"Calculating...")),f(this,"_prefix",()=>this.props.prefix?`${this.props.prefix} `:null),f(this,"_suffix",()=>this.props.suffix?` ${this.props.suffix}`:null)}UNSAFE_componentWillReceiveProps(){this.setState({prevMetric:this.props.metric,prevTs:this.state.nowTs,nowTs:o.Z.nowInSeconds()})}render(){if(!(this.props.metric&&this.props.metric.count!==void 0)){if(this.props.hideOnMissing)return null;if(!this._checkPrevMetric())return this._placeholder()}const{count:r}=this.props.metric;let n=null;if(this._checkPrevMetric()){const s=(r-this.state.prevMetric.count)/(this.state.nowTs-this.state.prevTs);n=e.createElement("span",{key:"rate",className:"number-format"},this._prefix(),l()(s).format("0,0"),this._suffix())}else return this._placeholder();return this.props.hideOnMissing&&!n?null:e.createElement("span",null,n,this.props.showTotal&&e.createElement("span",{key:"absolute",className:"number-format"}," (",l()(r).format("0")," total)"))}}f(M,"propTypes",{metric:a().object,showTotal:a().bool,prefix:a().string,suffix:a().string,hideOnZero:a().bool,hideOnMissing:a().bool}),f(M,"defaultProps",{showTotal:!1,prefix:null,suffix:"per second",hideOnZero:!1,hideOnMissing:!1});const K=M;var R=c("/GOzvPf6");const O={timer:"clock",histogram:"signal",meter:"play-circle",gauge:"tachometer-alt",counter:"circle",unknown:"question-circle"},W=t=>{var r;return(r=O[t])!=null?r:O.unknown},z=(t,r)=>{const s=t.split(r).slice(1).join(r);return e.createElement("span",null,e.createElement("span",{className:"prefix"},r),s)},D=({metric:t,namespace:r,nodeId:n})=>{const[s,i]=(0,e.useState)(!1),d=(0,e.useCallback)(g=>{g.preventDefault(),i(N=>!N)},[]),u=s?e.createElement(Z,{nodeId:n,metric:t}):null;return e.createElement("span",null,e.createElement("div",{className:"name"},e.createElement(R.JO,{name:W(t.type)})," ",e.createElement("a",{className:"open",href:"#",onClick:d},z(t.full_name,r))),u)};D.propTypes={metric:a().object.isRequired,namespace:a().string.isRequired,nodeId:a().string.isRequired};const j=D;var A=c("8fnsnG21"),I=c("5qbhaJ1A"),p=c("woUyHGxd");class x extends e.Component{componentDidMount(){const{name:r}=this.props;p.K.addGlobal(r)}shouldComponentUpdate(r){const{metricsUpdatedAt:n}=this.props;return n!==null&&r.metricsUpdatedAt?r.metricsUpdatedAt>n:!0}componentWillUnmount(){const{name:r}=this.props;p.K.removeGlobal(r)}render(){const{children:r,metrics:n,name:s,zeroOnMissing:i}=this.props;if(!n)return e.createElement("span",null,"Loading...");let d=Object.keys(n).map(u=>I.Z.getValuesForNode(n[u],{throughput:s})).reduce((u,g)=>({throughput:(u.throughput||0)+(g.throughput||0)}),{});return i&&(!d||!d.throughput)&&(d={throughput:0}),e.createElement("div",null,e.Children.map(r,u=>e.cloneElement(u,{metric:{full_name:s,count:d.throughput}})))}}x.propTypes={metricsUpdatedAt:a().number,name:a().string.isRequired,zeroOnMissing:a().bool},x.defaultProps={metricsUpdatedAt:o.Z.nowInSeconds(),zeroOnMissing:!0};const L=(0,A.Z)(x,{metricsStore:p.q},({metricsStore:t,...r})=>({...r,metrics:t.metrics,metricsUpdatedAt:t.metricsUpdatedAt}));var J=c("13uboeDm"),V=c.n(J),h=c("J6y4/h8P");const U=({metric:{metric:t}})=>e.createElement("dl",{className:"metric-def metric-counter"},e.createElement("dt",null,"Value:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.count).format("0,0"))));U.propTypes={metric:a().object.isRequired};const $=U,_=({metric:{metric:t}})=>e.createElement("dl",{className:"metric-def metric-gauge"},e.createElement("dt",null,"Value:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.value).format("0,0"))));_.propTypes={metric:a().object.isRequired};const k=_,P=({metric:{metric:t}})=>e.createElement("dl",{className:"metric-def metric-histogram"},e.createElement("dt",null,"95th percentile:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.time["95th_percentile"]).format("0,0.[00]"))),e.createElement("dt",null,"98th percentile:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.time["98th_percentile"]).format("0,0.[00]"))),e.createElement("dt",null,"99th percentile:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.time["99th_percentile"]).format("0,0.[00]"))),e.createElement("dt",null,"Standard deviation:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.time.std_dev).format("0,0.[00]"))),e.createElement("dt",null,"Mean:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.time.mean).format("0,0.[00]"))),e.createElement("dt",null,"Minimum:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.time.min).format("0,0.[00]"))),e.createElement("dt",null,"Maximum:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.time.max).format("0,0.[00]"))),e.createElement("dt",null,"Count:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.count).format("0,0"))));P.propTypes={metric:a().object.isRequired};const H=P,S=({metric:{metric:t}})=>e.createElement("dl",{className:"metric-def metric-meter"},e.createElement("dt",null,"Total:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.rate.total).format("0,0"))," events"),e.createElement("dt",null,"Mean:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.rate.mean).format("0,0.[00]"))," ",t.rate_unit),e.createElement("dt",null,"1 minute avg:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.rate.one_minute).format("0,0.[00]"))," ",t.rate_unit),e.createElement("dt",null,"5 minute avg:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.rate.five_minute).format("0,0.[00]"))," ",t.rate_unit),e.createElement("dt",null,"15 minute avg:"),e.createElement("dd",null,e.createElement("span",{className:"number-format"},l()(t.rate.fifteen_minute).format("0,0.[00]"))," ",t.rate_unit));S.propTypes={metric:a().object.isRequired};const X=S,w=({metric:{metric:{time:t}}})=>e.createElement("dl",{className:"metric-def metric-timer"},e.createElement("dt",null,"95th percentile:"),e.createElement("dd",null,e.createElement("span",null,l()(t["95th_percentile"]).format("0,0.[00]")),"\u03BCs"),e.createElement("dt",null,"98th percentile:"),e.createElement("dd",null,e.createElement("span",null,l()(t["98th_percentile"]).format("0,0.[00]")),"\u03BCs"),e.createElement("dt",null,"99th percentile:"),e.createElement("dd",null,e.createElement("span",null,l()(t["99th_percentile"]).format("0,0.[00]")),"\u03BCs"),e.createElement("dt",null,"Standard deviation:"),e.createElement("dd",null,e.createElement("span",null,l()(t.std_dev).format("0,0.[00]")),"\u03BCs"),e.createElement("dt",null,"Mean:"),e.createElement("dd",null,e.createElement("span",null,l()(t.mean).format("0,0.[00]")),"\u03BCs"),e.createElement("dt",null,"Minimum:"),e.createElement("dd",null,e.createElement("span",null,l()(t.min).format("0,0.[00]")),"\u03BCs"),e.createElement("dt",null,"Maximum:"),e.createElement("dd",null,e.createElement("span",null,l()(t.max).format("0,0.[00]")),"\u03BCs"));w.propTypes={metric:a().object.isRequired};const Q=w,Y=({metric:t})=>{switch(t.type){case"counter":return e.createElement($,{metric:t});case"gauge":return e.createElement(k,{metric:t});case"histogram":return e.createElement(H,{metric:t});case"meter":return e.createElement(X,{metric:t});case"timer":return e.createElement(Q,{metric:t});default:return e.createElement("i",null,"Invalid metric type: ",t)}},ee=h.default.div`
  dl {
    > dt {
      float: left;
    }

    &.metric-timer > dd {
      margin-left: 145px;
    }

    &.metric-meter > dd {
      margin-left: 115px;
    }

    &.metric-gauge > dd {
      margin-left: 90px;
    }

    &.metric-counter > dd {
      margin-left: 90px;
    }

    &.metric-histogram > dd {
      margin-left: 145px;
    }
  }
`,F=({nodeId:t,metric:r,metric:{full_name:n}})=>{var s,i;const d=(0,A.o)(p.q,N=>N.metrics);(0,e.useEffect)(()=>(p.K.add(t,n),()=>{p.K.remove(t,n)}),[n,t]);const u=(i=(s=d==null?void 0:d[t])==null?void 0:s[n])!=null?i:r,g=V()(u.type);return e.createElement("div",{className:"metric"},e.createElement("h3",null,g),e.createElement(ee,null,e.createElement(Y,{metric:u})))};F.propTypes={metric:a().object.isRequired,nodeId:a().string.isRequired};const Z=F;var E=c("uZqmR+ju"),te=c("TMaijZ0a");const re=h.default.div(({theme:t})=>`
  height: 20px;
  margin-bottom: 5px;
  color: ${t.colors.variant.dark.danger};
`),ne=(t,r)=>{try{const n=new RegExp(t,"i");return r.filter(s=>String(s.full_name).match(n))}catch{return[]}},ae=h.default.div`
  padding-top: 10px;
  width: 100%;
`;class C extends e.Component{constructor(r){super(r),this.onFilterChange=n=>{this.setState({filter:n})},this.state={filter:r.filter}}UNSAFE_componentWillReceiveProps(r){r.filter!==this.props.filter&&this.setState({filter:r.filter})}render(){const{filter:r}=this.state,{names:n,error:s}=this.props;if(!n)return e.createElement(E.Row,{className:"content"},e.createElement(E.Col,{md:12},e.createElement(E.Alert,{bsStyle:"danger"},s?e.createElement("span",null,"Could not fetch metrics from node: server returned ",e.createElement("em",null,s.responseMessage||"")," ","with a ",s.status," status code."):e.createElement("span",null,"There was a problem fetching node metrics.")," ","Graylog will keep trying to get them in the background.")));const i=ne(r,n);return e.createElement(E.Row,{className:"content"},e.createElement(E.Col,{md:12},e.createElement(re,{className:"text-warning"},s&&e.createElement(e.Fragment,null,e.createElement(R.JO,{name:"exclamation-triangle"}),"\xA0 Could not fetch metrics from node: server returned ",e.createElement("em",null,s.responseMessage||"")," ","with a ",s.status," status code. Displaying last metrics available.")),e.createElement(te.Z,{query:r,onSearch:this.onFilterChange,queryWidth:300,placeholder:"Type a metric name to filter\u2026"},e.createElement(ae,null,e.createElement(B,{names:i,namespace:this.props.namespace,nodeId:this.props.nodeId})))))}}C.propTypes={names:a().arrayOf(a().object),namespace:a().string.isRequired,nodeId:a().string.isRequired,filter:a().string,error:a().shape({responseMessage:a().string,status:a().number})},C.defaultProps={names:void 0,filter:"",error:void 0};const le=C,se=h.default.ul(({theme:t})=>(0,h.css)`
  padding: 0;

  li {
    margin-bottom: 5px;

    .prefix {
      color: ${t.colors.gray[70]};
    }

    .name {
      font-size: ${t.fonts.size.body};
      font-family: ${t.fonts.family.monospace};
      word-break: break-all;

      .open:hover {
        text-decoration: none;
      }
    }

    .metric {
      margin-left: 10px;
      padding: 10px;

      h3 {
        margin-bottom: 5px;
      }
    }
  }

  dl {
    margin-top: 0;
    margin-bottom: 0;
  }
`);class q extends e.Component{constructor(){super(...arguments),this._formatMetric=r=>{const{namespace:n,nodeId:s}=this.props;return e.createElement("li",{key:`li-${r.full_name}`},e.createElement(j,{key:r.full_name,metric:r,namespace:n,nodeId:s}))}}render(){const{names:r}=this.props,n=r.sort((s,i)=>s.full_name.localeCompare(i.full_name)).map(s=>this._formatMetric(s));return e.createElement(se,null,n.length>0?n:e.createElement("li",null,"No metrics match the given filter. Please ensure you use a valid regular expression"))}}q.propTypes={names:a().arrayOf(a().object).isRequired,namespace:a().string.isRequired,nodeId:a().string.isRequired};const B=q;var ce=c("D4SbLiE/"),ie=c.n(ce),me=c("JnTtTRmZ"),oe=c.n(me);const ue=ie()({displayName:"MetricsMapper",propTypes:{map:a().object.isRequired,computeValue:a().func.isRequired},mixins:[oe().connect(p.q)],getDefaultProps(){return{}},getInitialState(){return{}},UNSAFE_componentWillMount(){Object.keys(this.props.map).forEach(t=>p.K.addGlobal(this.props.map[t]))},shouldComponentUpdate(t,r){return this.state.metricsUpdatedAt&&r.metricsUpdatedAt?r.metricsUpdatedAt>this.state.metricsUpdatedAt:!0},componentWillUnmount(){Object.keys(this.props.map).forEach(t=>p.K.removeGlobal(this.props.map[t]))},render(){if(!this.state.metrics)return null;const t={};Object.keys(this.state.metrics).forEach(n=>{Object.keys(this.props.map).forEach(s=>{const i=this.props.map[s];this.state.metrics[n][i]&&(t[n]||(t[n]={}),t[n][s]=this.state.metrics[n][i])})});const r=this.props.computeValue(t);return e.createElement("span",null,r)}})},"5qbhaJ1A":(G,b,c)=>{c.d(b,{Z:()=>a});const a={getValuesForNode(e,v){if(e==null||Object.keys(e).length===0)return{};const l={};return Object.keys(v).forEach(o=>{const y=v[o],m=e[y];m&&(m.type==="gauge"?l[o]=m.metric.value:m.type==="counter"?l[o]=m.metric.count:m.type==="meter"||m.type==="timer"?l[o]=m.metric.rate.total:l[o]=null)}),l}}}}]);})();

//# sourceMappingURL=1255d548-5967.db64ad8f30f8fbf32c94.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy