|
@@ -471,7 +471,10 @@ class MonitorEnvironment(Model):
|
|
status = BoundedPositiveIntegerField(
|
|
status = BoundedPositiveIntegerField(
|
|
default=MonitorStatus.ACTIVE, choices=MonitorStatus.as_choices()
|
|
default=MonitorStatus.ACTIVE, choices=MonitorStatus.as_choices()
|
|
)
|
|
)
|
|
- next_checkin = models.DateTimeField(null=True)
|
|
|
|
|
|
+ next_checkin = models.DateTimeField(null=True) # the expected time of the next check-in
|
|
|
|
+ next_checkin_latest = models.DateTimeField(
|
|
|
|
+ null=True
|
|
|
|
+ ) # the latest expected time of the next check-in (includes check-in margin)
|
|
last_checkin = models.DateTimeField(null=True)
|
|
last_checkin = models.DateTimeField(null=True)
|
|
date_added = models.DateTimeField(default=timezone.now)
|
|
date_added = models.DateTimeField(default=timezone.now)
|
|
|
|
|
|
@@ -481,6 +484,9 @@ class MonitorEnvironment(Model):
|
|
app_label = "sentry"
|
|
app_label = "sentry"
|
|
db_table = "sentry_monitorenvironment"
|
|
db_table = "sentry_monitorenvironment"
|
|
unique_together = (("monitor", "environment"),)
|
|
unique_together = (("monitor", "environment"),)
|
|
|
|
+ indexes = [
|
|
|
|
+ models.Index(fields=["status", "next_checkin_latest"]),
|
|
|
|
+ ]
|
|
|
|
|
|
__repr__ = sane_repr("monitor_id", "environment_id")
|
|
__repr__ = sane_repr("monitor_id", "environment_id")
|
|
|
|
|