syntax = "proto3";

import "mapreduce/yt/interface/protos/extension.proto";
import "wmconsole/version3/junk/hostspeed/common.proto";

package NProcus;

enum ESourceType {
    OTHER = 0;
    YANDEX_SEARCH = 1;
};

enum ENetworkType {
    OTHER_NETWORK = 0;
    GSM = 1;
};

message THist {
    map<uint32, uint32> Values = 1;
}

message TSpeedHist {
    string Name = 1                 [(NYT.key_column_name) = "Name"];
    uint32 EventType = 2            [(NYT.key_column_name) = "EventType"];
    EDeviceType DeviceType = 3      [(NYT.key_column_name) = "DeviceType"];
    THist Hist = 4                  [(NYT.key_column_name) = "Hist"];
    ESourceType SourceType = 5      [(NYT.key_column_name) = "SourceType"];
    uint32 Index = 6                [(NYT.key_column_name) = "Index"];
    ENetworkType NetworkType = 7    [(NYT.key_column_name) = "NetworkType"];
    bool Turbo = 8                  [(NYT.key_column_name) = "Turbo"];
}

message TTurboShare {
    string Name = 1             [(NYT.key_column_name) = "Name"];
    uint32 EventType = 2        [(NYT.key_column_name) = "EventType"];
    EDeviceType DeviceType = 3  [(NYT.key_column_name) = "DeviceType"];
    uint32 Clicks = 4           [(NYT.column_name) = "Clicks"];
    uint32 Share = 5            [(NYT.column_name) = "Share"];
    ESourceType SourceType = 6  [(NYT.key_column_name) = "SourceType"];
}

message TSpeedFeatures {
    string Name = 1    [(NYT.key_column_name) = "Name"];
    uint32 EventType = 2;
    EDeviceType DeviceType = 3;
    uint32 Median = 4;
    uint32 Avg = 5;
    uint32 Perc95 = 6;
    uint32 Perc75 = 7;
    uint32 Clicks = 8;
    float MedianQuantile = 9;
    float Perc75Quantile = 10;
    float Perc95Quantile = 11;
    uint32 Perc90 = 12;
    float Perc90Quantile = 13;
    uint32 Index = 14;
    ESourceType SourceType = 15;
}

message TSpeedFactor {
    string Name = 1     [(NYT.key_column_name) = "Name"];
    float Value = 2     [(NYT.column_name) = "Value"];
    uint32 Clicks = 3   [(NYT.column_name) = "Clicks"];
}

message TGrade {
    string Name = 1         [(NYT.key_column_name) = "Name"];
    float Value = 2         [(NYT.column_name) = "Value"];
    uint32 Clicks = 3       [(NYT.column_name) = "Clicks"];
    uint32 TurboClicks = 4  [(NYT.column_name) = "TurboClicks"];
    uint32 TurboShare = 5   [(NYT.column_name) = "TurboShare"];
    uint32 Grade = 6        [(NYT.column_name) = "Grade"];
}
