Add several more util functions and tests (#4106)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-10-26 09:36:34 -04:00
1 parent 0aabc9a5de
commit 5abc1c618c
9 files changed
+132 -31

No files matched your search

+1 -3
View File
@@ -19,7 +19,6 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import _ from "lodash";
import type { LensApiRequest } from "../router";
import { respondJson } from "../utils/http-responses";
import type { Cluster } from "../cluster";
@@ -33,8 +32,7 @@ export type IMetricsQuery = string | string[] | {
};
// This is used for backoff retry tracking.
const MAX_ATTEMPTS = 5;
const ATTEMPTS = [...(_.fill(Array(MAX_ATTEMPTS - 1), false)), true];
const ATTEMPTS = [false, false, false, false, true];
// prometheus metrics loader
async function loadMetrics(promQueries: string[], cluster: Cluster, prometheusPath: string, queryParams: Record<string, string>): Promise<any[]> {