How to use the queue.max_bytes function in queue

To help you get started, we’ve selected a few queue examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / x-pack / legacy / plugins / logstash / public / models / pipeline / pipeline.js View on Github external
get upstreamJSON() {
    const settings = this.settings;
    const maxBytesNumber = get(settings, 'queue.max_bytes.number');
    const maxBytesUnits = get(settings, 'queue.max_bytes.units');

    const upstreamSettings = { ...settings };

    if (maxBytesNumber && maxBytesUnits) {
      delete upstreamSettings['queue.max_bytes.number'];
      delete upstreamSettings['queue.max_bytes.units'];
      upstreamSettings['queue.max_bytes'] = `${maxBytesNumber}${maxBytesUnits}`;
    }

    return {
      description: this.description,
      pipeline: this.pipeline,
      username: this.username,
      settings: upstreamSettings,
    };
  }
github elastic / kibana / x-pack / legacy / plugins / logstash / public / models / pipeline / pipeline.js View on Github external
static fromUpstreamJSON(pipeline) {
    const settings = pipeline.settings;

    const maxBytesStr = get(settings, 'queue.max_bytes', '');
    const maxBytesParts = maxBytesStr.match(/(\d+)(\w+)/);
    if (Array.isArray(maxBytesParts) && maxBytesParts.length === 3) {
      const maxBytesNumber = maxBytesParts[1];
      const maxBytesUnits = maxBytesParts[2];

      if (maxBytesNumber && maxBytesUnits) {
        delete settings['queue.max_bytes'];
        settings['queue.max_bytes.number'] = parseInt(maxBytesNumber);
        settings['queue.max_bytes.units'] = maxBytesUnits;
      }
    }

    return new Pipeline({
      id: pipeline.id,
      description: pipeline.description,
      pipeline: pipeline.pipeline,
      username: pipeline.username,
      settings,
    });
  }
github elastic / kibana / x-pack / legacy / plugins / logstash / public / components / pipeline_editor / pipeline_editor.js View on Github external
})}
                formRowTooltipText={TOOLTIPS.settings['queue.type']}
              >
                 this.handleSettingChange('queue.type', e.target.value)}
                  options={PIPELINE_EDITOR.QUEUE_TYPES}
                  value={this.state.pipeline.settings['queue.type']}
                />
              
              
                 this.handleMaxByteNumberChange(e.target.value)}
                  value={this.state.maxBytesNumber}
                />
              
              
                 this.handleMaxByteUnitChange(e.target.value)}
                  options={PIPELINE_EDITOR.UNITS}
                  value={this.state.maxBytesUnit}
                />
github elastic / kibana / x-pack / plugins / logstash / public / components / pipeline_editor / pipeline_editor.js View on Github external
})}
                formRowTooltipText={TOOLTIPS.settings['queue.type']}
              >
                 this.handleSettingChange('queue.type', e.target.value)}
                  options={PIPELINE_EDITOR.QUEUE_TYPES}
                  value={this.state.pipeline.settings['queue.type']}
                />
              
              
                 this.handleMaxByteNumberChange(e.target.value)}
                  value={this.state.maxBytesNumber}
                />
              
              
                 this.handleMaxByteUnitChange(e.target.value)}
                  options={PIPELINE_EDITOR.UNITS}
                  value={this.state.maxBytesUnit}
                />