# Generated by Django 1.11.10 on 2018-03-09 15:52

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('sites', '0002_alter_domain_unique'),
    ]

    operations = [
        migrations.CreateModel(
            name='ProcessInfo',
            fields=[
                ('start_time', models.DateTimeField(auto_now_add=True, help_text='Create time')),
                ('lastupdate_time', models.DateTimeField(auto_now=True, help_text='Time of the last change.')),
                ('pid', models.SmallIntegerField(help_text='process ID.', primary_key=True, serialize=False)),
                ('alive', models.NullBooleanField(help_text="Is this process dead (==False)? *Important:* alive is never==True! If alive==None: State unknown! (We don't check the state in every request!)")),
                ('db_query_count_min', models.PositiveIntegerField(help_text='Minimum database query count (ony available if settings.DEBUG==True)', verbose_name='Min db queries')),
                ('db_query_count_max', models.PositiveIntegerField(help_text='Maximum database query count (ony available if settings.DEBUG==True)', verbose_name='Max db queries')),
                ('db_query_count_avg', models.PositiveIntegerField(help_text='Average database query count (ony available if settings.DEBUG==True)', verbose_name='Avg db queries')),
                ('request_count', models.PositiveIntegerField(default=1, help_text='How many request answered since self.start_time', verbose_name='Requests')),
                ('exception_count', models.PositiveIntegerField(default=0, help_text='How many requests led to a exception.', verbose_name='Exceptions')),
                ('response_time_min', models.FloatField(help_text='Minimum processing time.')),
                ('response_time_max', models.FloatField(help_text='Maximum processing time.')),
                ('response_time_avg', models.FloatField(help_text='Average processing time.')),
                ('response_time_sum', models.FloatField(help_text='Total processing time.')),
                ('threads_avg', models.FloatField(help_text='Average number of threads per process.')),
                ('threads_min', models.PositiveSmallIntegerField()),
                ('threads_max', models.PositiveSmallIntegerField()),
                ('user_time_total', models.FloatField(help_text='total user mode time')),
                ('system_time_total', models.FloatField(help_text='total system mode time')),
                ('user_time_min', models.FloatField(help_text='Minimum user mode time')),
                ('system_time_min', models.FloatField(help_text='Minimum system mode time')),
                ('user_time_max', models.FloatField(help_text='Maximum user mode time')),
                ('system_time_max', models.FloatField(help_text='Maximum system mode time')),
                ('vm_peak_min', models.PositiveIntegerField(help_text='Minimum Peak virtual memory size (VmPeak) in Bytes')),
                ('vm_peak_max', models.PositiveIntegerField(help_text='Maximum Peak virtual memory size (VmPeak) in Bytes')),
                ('vm_peak_avg', models.PositiveIntegerField(help_text='Average Peak virtual memory size (VmPeak) in Bytes')),
                ('memory_min', models.PositiveIntegerField(help_text='Minimum Non-paged memory (VmRSS - Resident set size) in Bytes')),
                ('memory_max', models.PositiveIntegerField(help_text='Maximum Non-paged memory (VmRSS - Resident set size) in Bytes')),
                ('memory_avg', models.PositiveIntegerField(help_text='Average Non-paged memory (VmRSS - Resident set size) in Bytes')),
            ],
            options={
                'verbose_name': 'Process statistics',
                'verbose_name_plural': 'Process statistics',
                'ordering': ('-lastupdate_time',),
            },
        ),
        migrations.CreateModel(
            name='SiteStatistics',
            fields=[
                ('start_time', models.DateTimeField(auto_now_add=True, help_text='Create time')),
                ('lastupdate_time', models.DateTimeField(auto_now=True, help_text='Time of the last change.')),
                ('site', models.ForeignKey(default=1, help_text='settings.SITE_ID', on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='sites.Site')),
                ('process_spawn', models.PositiveIntegerField(default=1, help_text='Total number of processes spawend (approximated)')),
                ('process_count_avg', models.FloatField(default=1.0, help_text='Average number of living processes. (approximated)')),
                ('process_count_max', models.PositiveSmallIntegerField(default=1, help_text='Maximum number of living processes. (approximated)')),
            ],
            options={
                'verbose_name': 'Site statistics',
                'verbose_name_plural': 'Site statistics',
                'ordering': ('-lastupdate_time',),
            },
        ),
        migrations.AddField(
            model_name='processinfo',
            name='site',
            field=models.ForeignKey(default=settings.SITE_ID, help_text='settings.SITE_ID', on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
        ),
    ]
