skipper: github.com/zalando/skipper/filters/diag Index | Files

package diag

import "github.com/zalando/skipper/filters/diag"

Package diag provides a set of network throttling filters for diagnostic purpose.

The filters enable adding artificial latency, limiting bandwidth or chunking responses with custom chunk size and delay. This throttling can be applied to the proxy responses or to the outgoing backend requests. An additional filter, randomContent, can be used to generate response with random text of specified length.

Index

Package Files

absorb.go diag.go logheader.go

Constants

const (
    RandomName           = "randomContent"
    LatencyName          = "latency"
    ChunksName           = "chunks"
    BandwidthName        = "bandwidth"
    BackendLatencyName   = "backendLatency"
    BackendBandwidthName = "backendBandwidth"
    BackendChunksName    = "backendChunks"
)
const AbsorbName = "absorb"

AbsorbName contains the name of the absorb filter.

func NewAbsorb Uses

func NewAbsorb() filters.Spec

NewAbsorb initializes a filter spec for the absorb filter.

The absorb filter reads and discards the payload of the incoming requests. It logs with INFO level and a unique ID per request: - the event of receiving the request - partial and final events for consuming request payload and total consumed byte count - the finishing event of the request - any read errors other than EOF

func NewBackendBandwidth Uses

func NewBackendBandwidth() filters.Spec

NewBackendBandwidth is the equivalent of NewBandwidth but for outgoing backend requests. Eskip example:

* -> backendBandwidth(30) -> "https://www.example.org";

func NewBackendChunks Uses

func NewBackendChunks() filters.Spec

NewBackendChunks is the equivalent of NewChunks but for outgoing backend requests. Eskip example:

* -> backendChunks(1024, 120) -> "https://www.example.org";

func NewBackendLatency Uses

func NewBackendLatency() filters.Spec

NewBackendLatency is the equivalent of NewLatency but for outgoing backend requests. Eskip example:

* -> backendLatency(120) -> "https://www.example.org";

func NewBandwidth Uses

func NewBandwidth() filters.Spec

NewBandwidth creates a filter specification whose filter instances can be used to maximize the bandwidth of the responses. It expects the bandwidth in kbyte/sec as an argument.

* -> bandwidth(30) -> "https://www.example.org";

func NewChunks Uses

func NewChunks() filters.Spec

NewChunks creates a filter specification whose filter instances can be used set artificial delays in between response chunks. It expects the byte length of the chunks and the delay milliseconds.

* -> chunks(1024, "120ms") -> "https://www.example.org";

func NewLatency Uses

func NewLatency() filters.Spec

NewLatency creates a filter specification whose filter instances can be used to add additional latency to responses. It expects the latency in milliseconds as an argument. It always adds this value in addition to the natural latency, and does not do any adjustments. Eskip example:

* -> latency(120) -> "https://www.example.org";

func NewLogHeader Uses

func NewLogHeader() filters.Spec

NewLogHeader creates a filter specification for the 'logHeader()' filter.

func NewRandom Uses

func NewRandom() filters.Spec

NewRandom creates a filter specification whose filter instances can be used to respond to requests with random text of specified length. It expects the the byte length of the random response to be generated as an argument. Eskip example:

* -> randomContent(2048) -> <shunt>;

Package diag imports 11 packages (graph) and is imported by 5 packages. Updated 2020-03-03. Refresh now. Tools for package owners.