Documentation
¶
Index ¶
Constants ¶
View Source
const ( AutoHandle handle = "auto" YearHandle handle = "year" MonthHandle handle = "month" DayHandle handle = "day" HourHandle handle = "hour" MinuteHandle handle = "minute" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandleData ¶
type HandleData struct { Timestamp time.Time `bson:"_id"` // Идентификатор для свечки Count int `bson:"count"` // Кол-во документов в свече Documents []SystemEvent `bson:"doc"` // Документы которые вошли в свечу }
Структура для получения данных о свечке
type Statistic ¶
type Statistic struct {
// contains filtered or unexported fields
}
func NewStatistic ¶
func (*Statistic) Get ¶
func (s *Statistic) Get(name EventName, start, end time.Time, h handle, doc bool, filter *bson.D) ([]HandleData, error)
Построение статистики
Параметры: name - название события start, end - период для выборки h - выбор типа свечи для отображения событий doc - параметр отвечает за необходимость возврата документов событий в группе filter - указатель на шаг фильтрации документов
type SystemEvent ¶
type SystemEvent struct { ID primitive.ObjectID `bson:"_id"` // Идентификатор события Owner primitive.ObjectID `bson:"owner"` // Владелец события (может быть NilObjectID) Name EventName `bson:"name"` // Название события Timestamp time.Time `bson:"timestamp"` // Временная метка Data map[string]interface{} `bson:"data"` // Сопутствующая информация }
Click to show internal directories.
Click to hide internal directories.