stats

package
v0.1.72 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ValuePeriodSecond = "second"
	ValuePeriodMinute = "minute"
	ValuePeriodHour   = "hour"
	ValuePeriodDay    = "day"
	ValuePeriodWeek   = "week"
	ValuePeriodMonth  = "month"
	ValuePeriodYear   = "year"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Value

type Value struct {
	Id         shared.ObjectId        `bson:"_id" json:"id"`              // 数据库存储的ID
	Item       string                 `bson:"item" json:"item"`           // 指标代号
	Period     ValuePeriod            `bson:"period" json:"period"`       // 周期
	Value      map[string]interface{} `bson:"value" json:"value"`         // 数据内容
	Params     map[string]string      `bson:"params" json:"params"`       // 参数
	Timestamp  int64                  `bson:"timestamp" json:"timestamp"` // 时间戳
	TimeFormat struct {
		Year   string `bson:"year" json:"year"`
		Month  string `bson:"month" json:"month"`
		Week   string `bson:"week" json:"week"`
		Day    string `bson:"day" json:"day"`
		Hour   string `bson:"hour" json:"hour"`
		Minute string `bson:"minute" json:"minute"`
		Second string `bson:"second" json:"second"`
	} `bson:"timeFormat" json:"timeFormat"` // 时间信息
}

统计指标值定义

func NewItemValue

func NewItemValue() *Value

获取新对象

func (*Value) SetTime

func (this *Value) SetTime(t time.Time)

type ValuePeriod

type ValuePeriod = string

值周期

Jump to

Keyboard shortcuts

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