# Generated by Django 5.2.9 on 2026-01-13 10:46

import django.db.models.functions.datetime
from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="CPUMetric",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "timestamp",
                    models.DateTimeField(db_index=True, help_text="Metric timestamp"),
                ),
                (
                    "hostname",
                    models.CharField(
                        db_default="whitebox",
                        help_text="Host identifier",
                        max_length=255,
                    ),
                ),
                (
                    "usage_user",
                    models.FloatField(
                        db_default=0.0, help_text="% CPU time in user space"
                    ),
                ),
                (
                    "usage_system",
                    models.FloatField(
                        db_default=0.0, help_text="% CPU time in kernel space"
                    ),
                ),
                (
                    "usage_idle",
                    models.FloatField(db_default=100.0, help_text="% CPU time idle"),
                ),
                (
                    "usage_iowait",
                    models.FloatField(
                        blank=True, help_text="% CPU time waiting for I/O", null=True
                    ),
                ),
                (
                    "usage_active",
                    models.FloatField(
                        blank=True, help_text="% Total active CPU time", null=True
                    ),
                ),
                (
                    "usage_guest",
                    models.FloatField(
                        blank=True, help_text="% CPU time running guest VMs", null=True
                    ),
                ),
                (
                    "usage_guest_nice",
                    models.FloatField(
                        blank=True,
                        help_text="% CPU time running niced guest VMs",
                        null=True,
                    ),
                ),
                (
                    "usage_irq",
                    models.FloatField(
                        blank=True,
                        help_text="% CPU time servicing interrupts",
                        null=True,
                    ),
                ),
                (
                    "usage_nice",
                    models.FloatField(
                        blank=True,
                        help_text="% CPU time running niced processes",
                        null=True,
                    ),
                ),
                (
                    "usage_softirq",
                    models.FloatField(
                        blank=True,
                        help_text="% CPU time servicing soft interrupts",
                        null=True,
                    ),
                ),
                (
                    "usage_steal",
                    models.FloatField(
                        blank=True,
                        help_text="% CPU time stolen by hypervisor",
                        null=True,
                    ),
                ),
            ],
            options={
                "verbose_name": "CPU Metric",
                "verbose_name_plural": "CPU Metrics",
                "ordering": ["-timestamp"],
            },
        ),
        migrations.CreateModel(
            name="DiskIOMetric",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "timestamp",
                    models.DateTimeField(db_index=True, help_text="Metric timestamp"),
                ),
                (
                    "hostname",
                    models.CharField(
                        db_default="whitebox",
                        help_text="Host identifier",
                        max_length=255,
                    ),
                ),
                (
                    "device",
                    models.CharField(
                        db_default="unknown", help_text="Device name", max_length=255
                    ),
                ),
                (
                    "reads",
                    models.BigIntegerField(db_default=0, help_text="Number of reads"),
                ),
                (
                    "writes",
                    models.BigIntegerField(db_default=0, help_text="Number of writes"),
                ),
                (
                    "read_bytes",
                    models.BigIntegerField(db_default=0, help_text="Bytes read"),
                ),
                (
                    "write_bytes",
                    models.BigIntegerField(db_default=0, help_text="Bytes written"),
                ),
                (
                    "read_time_ms",
                    models.BigIntegerField(
                        db_default=0, help_text="Time spent reading (ms)"
                    ),
                ),
                (
                    "write_time_ms",
                    models.BigIntegerField(
                        db_default=0, help_text="Time spent writing (ms)"
                    ),
                ),
                (
                    "io_time_ms",
                    models.BigIntegerField(
                        db_default=0, help_text="Time spent doing I/Os (ms)"
                    ),
                ),
                (
                    "io_await",
                    models.FloatField(
                        blank=True, help_text="Average I/O wait time (ms)", null=True
                    ),
                ),
                (
                    "io_svctm",
                    models.FloatField(
                        blank=True, help_text="Average service time (ms)", null=True
                    ),
                ),
                (
                    "io_util",
                    models.FloatField(
                        blank=True, help_text="I/O utilization percentage", null=True
                    ),
                ),
                (
                    "iops_in_progress",
                    models.IntegerField(
                        db_default=0, help_text="I/O operations currently in progress"
                    ),
                ),
                (
                    "merged_reads",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Number of merged read operations",
                        null=True,
                    ),
                ),
                (
                    "merged_writes",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Number of merged write operations",
                        null=True,
                    ),
                ),
                (
                    "weighted_io_time",
                    models.BigIntegerField(
                        blank=True, help_text="Weighted I/O time (ms)", null=True
                    ),
                ),
            ],
            options={
                "verbose_name": "Disk I/O Metric",
                "verbose_name_plural": "Disk I/O Metrics",
                "ordering": ["-timestamp"],
            },
        ),
        migrations.CreateModel(
            name="DiskMetric",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "timestamp",
                    models.DateTimeField(db_index=True, help_text="Metric timestamp"),
                ),
                (
                    "hostname",
                    models.CharField(
                        db_default="whitebox",
                        help_text="Host identifier",
                        max_length=255,
                    ),
                ),
                (
                    "path",
                    models.CharField(
                        db_default="/", help_text="Mount path", max_length=255
                    ),
                ),
                (
                    "device",
                    models.CharField(
                        db_default="unknown", help_text="Device name", max_length=255
                    ),
                ),
                (
                    "fstype",
                    models.CharField(
                        db_default="unknown", help_text="Filesystem type", max_length=50
                    ),
                ),
                (
                    "total",
                    models.BigIntegerField(
                        db_default=0, help_text="Total space in bytes"
                    ),
                ),
                (
                    "used",
                    models.BigIntegerField(
                        db_default=0, help_text="Used space in bytes"
                    ),
                ),
                (
                    "free",
                    models.BigIntegerField(
                        db_default=0, help_text="Free space in bytes"
                    ),
                ),
                (
                    "used_percent",
                    models.FloatField(db_default=0.0, help_text="% disk used"),
                ),
                (
                    "inodes_total",
                    models.BigIntegerField(
                        blank=True, help_text="Total inodes", null=True
                    ),
                ),
                (
                    "inodes_used",
                    models.BigIntegerField(
                        blank=True, help_text="Used inodes", null=True
                    ),
                ),
                (
                    "inodes_free",
                    models.BigIntegerField(
                        blank=True, help_text="Free inodes", null=True
                    ),
                ),
                (
                    "inodes_used_percent",
                    models.FloatField(blank=True, help_text="% inodes used", null=True),
                ),
            ],
            options={
                "verbose_name": "Disk Metric",
                "verbose_name_plural": "Disk Metrics",
                "ordering": ["-timestamp"],
            },
        ),
        migrations.CreateModel(
            name="MemoryMetric",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "timestamp",
                    models.DateTimeField(db_index=True, help_text="Metric timestamp"),
                ),
                (
                    "hostname",
                    models.CharField(
                        db_default="whitebox",
                        help_text="Host identifier",
                        max_length=255,
                    ),
                ),
                (
                    "total",
                    models.BigIntegerField(
                        db_default=0, help_text="Total memory in bytes"
                    ),
                ),
                (
                    "available",
                    models.BigIntegerField(
                        db_default=0, help_text="Available memory in bytes"
                    ),
                ),
                (
                    "used",
                    models.BigIntegerField(
                        db_default=0, help_text="Used memory in bytes"
                    ),
                ),
                (
                    "used_percent",
                    models.FloatField(db_default=0.0, help_text="% memory used"),
                ),
                (
                    "cached",
                    models.BigIntegerField(
                        blank=True, help_text="Cached memory in bytes", null=True
                    ),
                ),
                (
                    "buffered",
                    models.BigIntegerField(
                        blank=True, help_text="Buffered memory in bytes", null=True
                    ),
                ),
                (
                    "active",
                    models.BigIntegerField(
                        blank=True, help_text="Recently used memory in bytes", null=True
                    ),
                ),
                (
                    "inactive",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Memory not recently used in bytes",
                        null=True,
                    ),
                ),
                (
                    "free",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Completely unused memory in bytes",
                        null=True,
                    ),
                ),
                (
                    "available_percent",
                    models.FloatField(
                        blank=True, help_text="% memory available", null=True
                    ),
                ),
                (
                    "shared",
                    models.BigIntegerField(
                        blank=True, help_text="Shared memory in bytes", null=True
                    ),
                ),
                (
                    "mapped",
                    models.BigIntegerField(
                        blank=True, help_text="Mapped files in bytes", null=True
                    ),
                ),
                (
                    "dirty",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Memory waiting to be written in bytes",
                        null=True,
                    ),
                ),
                (
                    "write_back",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Memory being written back in bytes",
                        null=True,
                    ),
                ),
                (
                    "write_back_tmp",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Temporary writeback memory in bytes",
                        null=True,
                    ),
                ),
                (
                    "swap_total",
                    models.BigIntegerField(
                        blank=True, help_text="Total swap space in bytes", null=True
                    ),
                ),
                (
                    "swap_free",
                    models.BigIntegerField(
                        blank=True, help_text="Free swap space in bytes", null=True
                    ),
                ),
                (
                    "swap_cached",
                    models.BigIntegerField(
                        blank=True, help_text="Cached swap in bytes", null=True
                    ),
                ),
                (
                    "slab",
                    models.BigIntegerField(
                        blank=True, help_text="Kernel slab memory in bytes", null=True
                    ),
                ),
                (
                    "sreclaimable",
                    models.BigIntegerField(
                        blank=True, help_text="Reclaimable slab in bytes", null=True
                    ),
                ),
                (
                    "sunreclaim",
                    models.BigIntegerField(
                        blank=True, help_text="Unreclaimable slab in bytes", null=True
                    ),
                ),
                (
                    "page_tables",
                    models.BigIntegerField(
                        blank=True, help_text="Page table memory in bytes", null=True
                    ),
                ),
                (
                    "commit_limit",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Total committable memory in bytes",
                        null=True,
                    ),
                ),
                (
                    "committed_as",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Currently committed memory in bytes",
                        null=True,
                    ),
                ),
                (
                    "high_total",
                    models.BigIntegerField(
                        blank=True, help_text="High memory total in bytes", null=True
                    ),
                ),
                (
                    "high_free",
                    models.BigIntegerField(
                        blank=True, help_text="High memory free in bytes", null=True
                    ),
                ),
                (
                    "low_total",
                    models.BigIntegerField(
                        blank=True, help_text="Low memory total in bytes", null=True
                    ),
                ),
                (
                    "low_free",
                    models.BigIntegerField(
                        blank=True, help_text="Low memory free in bytes", null=True
                    ),
                ),
                (
                    "huge_page_size",
                    models.BigIntegerField(
                        blank=True, help_text="Size of huge pages in bytes", null=True
                    ),
                ),
                (
                    "huge_pages_total",
                    models.BigIntegerField(
                        blank=True, help_text="Total huge pages", null=True
                    ),
                ),
                (
                    "huge_pages_free",
                    models.BigIntegerField(
                        blank=True, help_text="Free huge pages", null=True
                    ),
                ),
                (
                    "vmalloc_total",
                    models.BigIntegerField(
                        blank=True, help_text="Total vmalloc area in bytes", null=True
                    ),
                ),
                (
                    "vmalloc_used",
                    models.BigIntegerField(
                        blank=True, help_text="Used vmalloc area in bytes", null=True
                    ),
                ),
                (
                    "vmalloc_chunk",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Largest free vmalloc chunk in bytes",
                        null=True,
                    ),
                ),
            ],
            options={
                "verbose_name": "Memory Metric",
                "verbose_name_plural": "Memory Metrics",
                "ordering": ["-timestamp"],
            },
        ),
        migrations.CreateModel(
            name="NetworkMetric",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "timestamp",
                    models.DateTimeField(db_index=True, help_text="Metric timestamp"),
                ),
                (
                    "hostname",
                    models.CharField(
                        db_default="whitebox",
                        help_text="Host identifier",
                        max_length=255,
                    ),
                ),
                (
                    "interface",
                    models.CharField(
                        db_default="unknown",
                        help_text="Network interface name",
                        max_length=255,
                    ),
                ),
                (
                    "bytes_sent",
                    models.BigIntegerField(db_default=0, help_text="Bytes sent"),
                ),
                (
                    "bytes_recv",
                    models.BigIntegerField(db_default=0, help_text="Bytes received"),
                ),
                (
                    "packets_sent",
                    models.BigIntegerField(db_default=0, help_text="Packets sent"),
                ),
                (
                    "packets_recv",
                    models.BigIntegerField(db_default=0, help_text="Packets received"),
                ),
                (
                    "err_in",
                    models.BigIntegerField(db_default=0, help_text="Receive errors"),
                ),
                (
                    "err_out",
                    models.BigIntegerField(db_default=0, help_text="Send errors"),
                ),
                (
                    "drop_in",
                    models.BigIntegerField(
                        db_default=0, help_text="Dropped incoming packets"
                    ),
                ),
                (
                    "drop_out",
                    models.BigIntegerField(
                        db_default=0, help_text="Dropped outgoing packets"
                    ),
                ),
                (
                    "speed",
                    models.IntegerField(
                        blank=True, help_text="Link speed in Mbps", null=True
                    ),
                ),
            ],
            options={
                "verbose_name": "Network Metric",
                "verbose_name_plural": "Network Metrics",
                "ordering": ["-timestamp"],
            },
        ),
        migrations.CreateModel(
            name="SystemMetric",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "timestamp",
                    models.DateTimeField(db_index=True, help_text="Metric timestamp"),
                ),
                (
                    "hostname",
                    models.CharField(
                        db_default="whitebox",
                        help_text="Host identifier",
                        max_length=255,
                    ),
                ),
                (
                    "uptime",
                    models.BigIntegerField(
                        db_default=0, help_text="System uptime in seconds"
                    ),
                ),
                (
                    "processes_running",
                    models.IntegerField(
                        db_default=0, help_text="Number of running processes"
                    ),
                ),
                (
                    "processes_total",
                    models.IntegerField(
                        db_default=0, help_text="Total number of processes"
                    ),
                ),
                (
                    "load_1m",
                    models.FloatField(
                        blank=True, help_text="1-minute load average", null=True
                    ),
                ),
                (
                    "load_5m",
                    models.FloatField(
                        blank=True, help_text="5-minute load average", null=True
                    ),
                ),
                (
                    "load_15m",
                    models.FloatField(
                        blank=True, help_text="15-minute load average", null=True
                    ),
                ),
                (
                    "n_cpus",
                    models.IntegerField(
                        blank=True, help_text="Number of logical CPUs", null=True
                    ),
                ),
                (
                    "n_physical_cpus",
                    models.IntegerField(
                        blank=True, help_text="Number of physical CPUs", null=True
                    ),
                ),
                (
                    "uptime_format",
                    models.CharField(
                        blank=True,
                        help_text="Human-readable uptime",
                        max_length=50,
                        null=True,
                    ),
                ),
            ],
            options={
                "verbose_name": "System Metric",
                "verbose_name_plural": "System Metrics",
                "ordering": ["-timestamp"],
            },
        ),
        migrations.CreateModel(
            name="TemperatureMetric",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                (
                    "timestamp",
                    models.DateTimeField(db_index=True, help_text="Metric timestamp"),
                ),
                (
                    "hostname",
                    models.CharField(
                        db_default="whitebox",
                        help_text="Host identifier",
                        max_length=255,
                    ),
                ),
                (
                    "sensor",
                    models.CharField(
                        db_default="unknown",
                        help_text="Temperature sensor name",
                        max_length=255,
                    ),
                ),
                (
                    "temp",
                    models.FloatField(
                        db_default=0.0, help_text="Temperature in Celsius"
                    ),
                ),
            ],
            options={
                "verbose_name": "Temperature Metric",
                "verbose_name_plural": "Temperature Metrics",
                "ordering": ["-timestamp"],
            },
        ),
    ]
