mirror of
https://github.com/prymitive/karma
synced 2026-08-23 11:56:20 +00:00
feat(demo): generate long list of alerts to test lazy load / pagination
This commit is contained in:
@@ -12,6 +12,11 @@ route:
|
||||
match_re:
|
||||
alertname: .*
|
||||
continue: true
|
||||
- receiver: "pagination"
|
||||
group_by: ["alertname", "instance"]
|
||||
match_re:
|
||||
alertname: Pagination Test
|
||||
continue: false
|
||||
- receiver: "by-cluster-service"
|
||||
group_by: ["alertname", "cluster", "service"]
|
||||
match_re:
|
||||
@@ -38,6 +43,7 @@ inhibit_rules:
|
||||
|
||||
receivers:
|
||||
- name: "default"
|
||||
- name: "pagination"
|
||||
- name: "by-cluster-service"
|
||||
- name: "by-name"
|
||||
- name: "by-cluster"
|
||||
|
||||
@@ -398,6 +398,21 @@ class SilencedAlertWithJiraLink(AlertGenerator):
|
||||
]
|
||||
|
||||
|
||||
class PaginationTest(AlertGenerator):
|
||||
name = "Pagination Test"
|
||||
comment = "Huge number of alerts to test pagination & lazy load"
|
||||
|
||||
def alerts(self):
|
||||
return [
|
||||
newAlert(
|
||||
self._labels(instance="server{}".format(i), cluster="dev",
|
||||
severity="warning", job="node_exporter",
|
||||
region="US"),
|
||||
self._annotations(dashboard="https://example.com")
|
||||
) for i in xrange(0, 1000)
|
||||
]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
generators = [
|
||||
AlwaysOnAlert(MAX_INTERVAL),
|
||||
@@ -412,6 +427,7 @@ if __name__ == "__main__":
|
||||
InhibitedAlert(MAX_INTERVAL),
|
||||
InhibitingAlert(MAX_INTERVAL),
|
||||
SilencedAlertWithJiraLink(MAX_INTERVAL),
|
||||
PaginationTest(MAX_INTERVAL),
|
||||
]
|
||||
while True:
|
||||
for g in generators:
|
||||
|
||||
Reference in New Issue
Block a user