package NWebmaster.NProto;

import "mapreduce/yt/interface/protos/extension.proto";

message TPageSample {
    optional string Path               = 1      [(NYT.key_column_name) = "Host"];
    optional int64 LastAccess          = 2      [(NYT.column_name) = "LastAccess"];
    optional uint32 HttpCode           = 3      [(NYT.column_name) = "HttpCode"];
    optional int64 FetchTime           = 4      [(NYT.column_name) = "FetchTime"];
    optional string MainUrl            = 5      [(NYT.column_name) = "MainUrl"];
}

message TContentAttrSample {
    optional string Value              = 1;
    optional int64 Count               = 2;
    repeated TPageSample PageSamples   = 3;
}

message THostSamples {
    optional TPageSample MordaSample                   = 1;
    repeated TPageSample EmptyTitleSamples             = 2;
    repeated TPageSample EmptyDescriptionSamples       = 3;
    repeated TPageSample SlowPageSamples               = 4;
    repeated TContentAttrSample PrevailingTitles       = 5;
    repeated TContentAttrSample PrevailingDescriptions = 6;
    repeated TPageSample DuplicatePageSamples          = 7;
}

message THostStatistics {
    optional string Host                   = 1       [(NYT.key_column_name) = "Host"];
    optional int64 Docs                    = 2       [(NYT.column_name) = "Docs"];
    optional int64 DocsOnSearch            = 3       [(NYT.column_name) = "DocsOnSearch"];
    optional int64 HtmlDocs                = 4       [(NYT.column_name) = "HtmlDocs"];
    optional int64 GoodDocsOnSearch        = 5       [(NYT.column_name) = "GoodDocsOnSearch"];
    optional int64 EmptyTitles             = 6       [(NYT.column_name) = "EmptyTitles"];
    optional int64 EmptyDescriptions       = 7       [(NYT.column_name) = "EmptyDescriptions"];
    optional int64 SlowPages               = 8       [(NYT.column_name) = "SlowPages"];
    optional int64 PagesWithFetchTime      = 9       [(NYT.column_name) = "PagesWithFetchTime"];
    optional int64 TotalFetchTime          = 10      [(NYT.column_name) = "TotalFetchTime"];
    optional int64 UniqueTitles            = 11      [(NYT.column_name) = "UniqueTitles"];
    optional int64 UniqueDescriptions      = 12      [(NYT.column_name) = "UniqueDescriptions"];
    optional int64 DuplicateTitles         = 13      [(NYT.column_name) = "DuplicateTitles"];
    optional int64 DuplicateDescriptions   = 14      [(NYT.column_name) = "DuplicateDescriptions"];
    optional THostSamples Samples          = 15      [(NYT.column_name) = "Samples"];
    optional int64 DuplicatePages          = 16      [(NYT.column_name) = "DuplicatePages"];
}

message THostStatus {
    optional string Host                   = 1       [(NYT.key_column_name) = "Host"];
    optional uint64 LastAccess             = 2       [(NYT.column_name) = "LastAccess"];
    optional uint64 IP                     = 3       [(NYT.column_name) = "IP"];
    optional string IPv6                   = 4       [(NYT.column_name) = "IPv6"];
    optional uint64 HostStatus             = 5       [(NYT.column_name) = "HostStatus"];
    optional string Robots                 = 6       [(NYT.column_name) = "Robots"];
    optional uint64 RobotsHTTPCode         = 7       [(NYT.column_name) = "RobotsHTTPCode"];
    optional uint64 RobotsLastAccess       = 8       [(NYT.column_name) = "RobotsLastAccess"];
    optional string RobotsHTTPResponse     = 9       [(NYT.column_name) = "RobotsHTTPResponse"];
    optional bool HasSslCertErrors         = 10      [(NYT.column_name) = "HasSslCertErrors"];
    optional uint64 AcknowledgementTime    = 11      [(NYT.column_name) = "AcknowledgementTime"];
    optional string RobotsHeaders          = 12      [(NYT.column_name) = "RobotsHeaders"];
}

message THostContentAttrSamples {
    repeated TPageSample PageSamples = 4;
}

message THostContentAttrStatistics {
    optional string Host                     = 1     [(NYT.key_column_name) = "Host"];
    optional int64 Hash                      = 2     [(NYT.key_column_name) = "Hash"];
    optional string Value                    = 3     [(NYT.column_name) = "Value"];
    optional int64 Count                     = 4     [(NYT.column_name) = "Count"];
    optional int64 CountNegative             = 5     [(NYT.column_name) = "CountNegative"];
    optional int64 Uniques                   = 6     [(NYT.column_name) = "Uniques"];
    optional int64 Duplicates                = 7     [(NYT.column_name) = "Duplicates"];
    optional THostContentAttrSamples Samples = 8     [(NYT.column_name) = "Samples"];
}

message THostProblems {
    optional string Host                     = 1     [(NYT.key_column_name) = "Host"];
    optional string Type                     = 2     [(NYT.key_column_name) = "Type"];
    optional int64 ActualSince               = 3     [(NYT.column_name) = "ActualSince"];
    optional int64 LastUpdate                = 4     [(NYT.column_name) = "LastUpdate"];
    optional string Data                     = 5     [(NYT.column_name) = "Data"];
}

message TMordaSample {
    optional string Host               = 1      [(NYT.key_column_name) = "Host"];
    optional int64 LastAccess          = 2      [(NYT.column_name) = "LastAccess"];
    optional uint32 HttpCode           = 3      [(NYT.column_name) = "HttpCode"];
    optional int64 FetchTime           = 4      [(NYT.column_name) = "FetchTime"];
}

message THostRegions {
    optional string Host               = 1      [(NYT.column_name) = "Host"];
    optional string MainHost           = 2      [(NYT.column_name) = "MainHost"];
    repeated int64 DictionaryRegions   = 3      [(NYT.column_name) = "DictionaryRegions", (NYT.flags) = SERIALIZATION_YT];
    repeated int64 WebmasterRegions    = 4      [(NYT.column_name) = "WebmasterRegions", (NYT.flags) = SERIALIZATION_YT];
}

message TWebmasterHost {
    optional string Host = 1            [(NYT.key_column_name) = "Host"];
}

