from django.db import models
import os, errno

from api.utils import *

class SystemPerformanceManager(models.Manager):
    def statistic(self, start, end):
      # 系统性能可能后续要加入历史统计功能，预留相关函数
      pass

class SystemPerformance(models.Model):
    cpu = models.FloatField()
    mem_total = models.FloatField()
    mem_used = models.FloatField()
    create_time = models.DateTimeField(auto_now_add=True)

    objects = SystemPerformanceManager()

    class Meta:
        app_label = 'api'
