model

package
v0.0.0-...-83adff0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WilsonLHRRAlgorithm      = "wilsonLHRR"
	WilsonLHRRFluidAlgorithm = "wilsonLHRRFluid"
	OriginAlgorithm          = "origin"
	LikeDescAlgorithm        = "likeDesc"

	StateInactive = int(0)
	StateActive   = int(1)

	SlotsNum = 100

	DefaultSlotName  = "default"
	DefaultAlgorithm = "default"
	DefaultWeight    = ""
)

const var

Variables

This section is empty.

Functions

This section is empty.

Types

type EventMsg

type EventMsg struct {
	Action string `json:"action"`
	Oid    int64  `json:"oid"`
	Tp     int    `json:"tp"`
}

EventMsg EventMsg

type SSDateRes

type SSDateRes struct {
	Legend []string                     `json:"legend"`
	XAxis  []int                        `json:"x_axis"`
	Series map[string][]*StatisticsStat `json:"series"`
}

SSDateRes ss res

func (*SSDateRes) Sort

func (s *SSDateRes) Sort()

Sort ...

type SSHourRes

type SSHourRes struct {
	Legend []string                     `json:"legend"`
	XAxis  []string                     `json:"x_axis"`
	Series map[string][]*StatisticsStat `json:"series"`
}

SSHourRes ss res

func (*SSHourRes) Sort

func (s *SSHourRes) Sort()

Sort ...

type SSReq

type SSReq struct {
	DateFrom int64 `form:"date_from" validate:"required"`
	DateEnd  int64 `form:"date_end" validate:"required"`
	Hour     bool  `form:"hour"`
}

SSReq ss req

type SlotsMapping

type SlotsMapping struct {
	Name  string
	Slots []int
	State int
}

SlotsMapping slot name mapping

type SlotsStat

type SlotsStat struct {
	Name      string
	Slots     []int
	Algorithm string
	Weight    string
	State     int
}

SlotsStat slots stat

type StatisticsStat

type StatisticsStat struct {
	// 流量所属槽位 0~99
	Slot int
	// 所属实验组名
	Name          string
	State         int
	Date          int
	Hour          int
	HotLike       int64
	HotHate       int64
	HotReport     int64
	HotChildReply int64
	// 整个评论区
	TotalLike       int64
	TotalHate       int64
	TotalReport     int64
	TotalChildReply int64
	TotalRootReply  int64
	// 用户点开评论区次数
	View uint32
	// 评论列表接口调用次数
	TotalView uint32
	// 热门评论接口调用次数
	HotView uint32
	// 更多热门评论点击次数
	HotClick uint32

	// UV的统计数据
	HotLikeUV   int64
	HotHateUV   int64
	HotReportUV int64
	HotChildUV  int64

	TotalLikeUV   int64
	TotalHateUV   int64
	TotalReportUV int64
	TotalChildUV  int64
	TotalRootUV   int64
}

StatisticsStat 实验组或者对照组的各项统计

func (*StatisticsStat) DivideByPercent

func (stat1 *StatisticsStat) DivideByPercent(percent int64) (stat2 *StatisticsStat)

DivideByPercent ...

func (*StatisticsStat) Merge

func (stat1 *StatisticsStat) Merge(stat2 *StatisticsStat) (stat3 *StatisticsStat)

Merge Merge

func (*StatisticsStat) MergeByDate

func (stat1 *StatisticsStat) MergeByDate(stat2 *StatisticsStat) (stat3 *StatisticsStat)

MergeByDate MergeByDate

type StatisticsStats

type StatisticsStats []*StatisticsStat

StatisticsStats StatisticsStats

func (StatisticsStats) GroupByName

func (s StatisticsStats) GroupByName() (res map[string]StatisticsStats)

GroupByName group statistics by name

type WilsonLHRRFluidWeight

type WilsonLHRRFluidWeight struct {
	Like   float64 `json:"like"`
	Hate   float64 `json:"hate"`
	Reply  float64 `json:"reply"`
	Report float64 `json:"report"`
	Slope  float64 `json:"slope"`
}

WilsonLHRRFluidWeight WilsonLHRRFluidWeight

func (WilsonLHRRFluidWeight) Validate

func (weight WilsonLHRRFluidWeight) Validate() (err error)

Validate Validate

type WilsonLHRRWeight

type WilsonLHRRWeight struct {
	Like   float64 `json:"like"`
	Hate   float64 `json:"hate"`
	Reply  float64 `json:"reply"`
	Report float64 `json:"report"`
}

WilsonLHRRWeight wilson score interval weight

func (WilsonLHRRWeight) Validate

func (weight WilsonLHRRWeight) Validate() (err error)

Validate Validate

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL