mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
23094b016e
## What We've already added the backend for this. This is the initial work for drawing a chart for instance traffic in the frontend. It requires the environment variable `PROMETHEUS_API` set to a valid prometheus-query-language (promql) supported backend, such as Prometheus itself or Victoria Metrics. Besides, at the moment we're hiding this functionality behind the flag `UNLEASH_EXPERIMENTAL_NETWORK_VIEW` which has to be set to true Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai> Co-authored-by: Gastón Fournier <gaston@getunleash.ai>
13 lines
306 B
TypeScript
13 lines
306 B
TypeScript
export class CyclicIterator<T> {
|
|
private current = 0;
|
|
readonly all: T[];
|
|
constructor(defaultList: T[]) {
|
|
this.all = defaultList;
|
|
}
|
|
next(): T {
|
|
const item = this.all[this.current];
|
|
this.current = (this.current + 1) % this.all.length;
|
|
return item;
|
|
}
|
|
}
|