2020-12-10 12:50:22 +00:00
|
|
|
import uuid
|
|
|
|
|
|
|
|
from django.db import models
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
2021-03-26 11:09:34 +00:00
|
|
|
from common.utils import get_logger
|
|
|
|
|
|
|
|
|
|
|
|
logger = get_logger(__name__)
|
2020-12-10 12:50:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Status(models.Model):
|
|
|
|
id = models.UUIDField(default=uuid.uuid4, primary_key=True)
|
|
|
|
session_online = models.IntegerField(verbose_name=_("Session Online"), default=0)
|
2021-03-26 11:09:34 +00:00
|
|
|
cpu_load = models.FloatField(verbose_name=_("CPU Load"), default=0)
|
2020-12-10 12:50:22 +00:00
|
|
|
memory_used = models.FloatField(verbose_name=_("Memory Used"))
|
2021-03-26 11:09:34 +00:00
|
|
|
disk_used = models.FloatField(verbose_name=_("Disk Used"), default=0)
|
|
|
|
connections = models.IntegerField(verbose_name=_("Connections"), default=0)
|
|
|
|
threads = models.IntegerField(verbose_name=_("Threads"), default=0)
|
|
|
|
boot_time = models.FloatField(verbose_name=_("Boot Time"), default=0)
|
2022-11-04 03:40:16 +00:00
|
|
|
terminal = models.ForeignKey('terminal.Terminal', null=True, on_delete=models.CASCADE)
|
2020-12-10 12:50:22 +00:00
|
|
|
date_created = models.DateTimeField(auto_now_add=True)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
db_table = 'terminal_status'
|
|
|
|
get_latest_by = 'date_created'
|
2022-02-17 12:13:31 +00:00
|
|
|
verbose_name = _("Status")
|
2020-12-10 12:50:22 +00:00
|
|
|
|
2022-02-17 12:13:31 +00:00
|
|
|
|