# Generated by Django 5.1.6 on 2025-02-23 14:01

import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="ResourceUsage",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "from_time",
                    models.DateTimeField(
                        blank=True,
                        db_comment="Start time of the resource usage period (Optional).",
                        help_text="The optional start time of the resource usage monitoring period.",
                        null=True,
                        verbose_name="Start Time",
                    ),
                ),
                (
                    "to_time",
                    models.DateTimeField(
                        db_comment="End time of the resource usage period or the time when resource usage was recorded.",
                        default=django.utils.timezone.now,
                        help_text="The end time of the resource usage monitoring period. Defaults to now if not provided.",
                        verbose_name="End Time",
                    ),
                ),
                (
                    "cpu_usage",
                    models.FloatField(
                        db_comment="CPU usage percentage.",
                        help_text="Percentage of CPU usage at the time of logging.",
                        verbose_name="CPU Usage",
                    ),
                ),
                (
                    "memory_usage",
                    models.FloatField(
                        db_comment="Memory (RAM) usage percentage.",
                        help_text="Percentage of RAM usage at the time of logging.",
                        verbose_name="Memory Usage",
                    ),
                ),
                (
                    "disk_usage",
                    models.FloatField(
                        db_comment="Disk usage percentage.",
                        help_text="Percentage of disk space used at the time of logging.",
                        verbose_name="Disk Usage",
                    ),
                ),
                (
                    "total_network_sent",
                    models.FloatField(
                        db_comment="Network data sent in megabytes (MB).",
                        help_text="Amount of data sent over the network (in MB).",
                        verbose_name="Total Network Sent",
                    ),
                ),
                (
                    "total_network_received",
                    models.FloatField(
                        db_comment="Network data received in megabytes (MB).",
                        help_text="Amount of data received over the network (in MB).",
                        verbose_name="Total Network Received",
                    ),
                ),
                (
                    "total_disk_read",
                    models.FloatField(
                        db_comment="Total disk read in megabytes (MB).",
                        help_text="Total amount of data read from the disk (in MB).",
                        verbose_name="Total Disk Read",
                    ),
                ),
                (
                    "total_disk_write",
                    models.FloatField(
                        db_comment="Total disk write in megabytes (MB).",
                        help_text="Total amount of data written to the disk (in MB).",
                        verbose_name="Total Disk Write",
                    ),
                ),
            ],
            options={
                "verbose_name": "Resource Usage",
                "verbose_name_plural": "Resource Usages",
                "ordering": ["-to_time"],
            },
        ),
    ]
