Documentation ¶
Index ¶
- Constants
- type App
- type AppShadow
- type Db
- type Dbcfg
- func (cfg Dbcfg) FlushExceptions()
- func (cfg Dbcfg) GetAppList() ([]AppShadow, error)
- func (cfg Dbcfg) GetDailyList(id primitive.ObjectID) (*[]stats.DailyMetric, error)
- func (cfg Dbcfg) GetExceptions() (*[]AppShadow, error)
- func (cfg Dbcfg) GetMonthlyList(id primitive.ObjectID) (*[]Metric, error)
- func (cfg Dbcfg) PushDaily(id primitive.ObjectID, element *stats.DailyMetric) error
- func (cfg Dbcfg) PushException(app *AppShadow) error
- func (cfg Dbcfg) PushMonthly(id primitive.ObjectID, element *Metric) error
- func (cfg Dbcfg) UpdateDailyList(id primitive.ObjectID, newMetricList *[]stats.DailyMetric) error
- func (cfg Dbcfg) UpdateMonthlyList(id primitive.ObjectID, newMetricList *[]Metric) error
- type Metric
Constants ¶
View Source
const ( DBTIMEOUT = 10 DATEPATTERN = "2006-01-02 15:04:05" STATSCOL = "population_stats" EXCCOL = "exceptions" )
DB Constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { ID primitive.ObjectID `bson:"_id,omitempty"` Name string `bson:"name"` AppID int `bson:"app_id"` Metrics []Metric `bson:"metrics"` DailyMetrics []stats.DailyMetric `bson:"daily_metrics"` Domain string `bson:"domain"` }
App - Entry in the DB is of this format
type Db ¶
type Db interface { GetAppList() ([]AppShadow, error) GetMonthlyList(id primitive.ObjectID) (*[]Metric, error) GetDailyList(id primitive.ObjectID) (*[]stats.DailyMetric, error) GetExceptions() (*[]AppShadow, error) PushDaily(id primitive.ObjectID, element *stats.DailyMetric) error PushMonthly(id primitive.ObjectID, element *Metric) error PushException(app *AppShadow) error UpdateMonthlyList(id primitive.ObjectID, newMetricList *[]Metric) error UpdateDailyList(id primitive.ObjectID, newMetricList *[]stats.DailyMetric) error FlushExceptions() }
Db interface
type Dbcfg ¶
Dbcfg : composition: Dbcfg implements interface (allows implementation of the below methods)
func (Dbcfg) FlushExceptions ¶
func (cfg Dbcfg) FlushExceptions()
FlushExceptions : Clear exception queue
func (Dbcfg) GetAppList ¶
GetAppList : Get List of Apps as AppMeta
func (Dbcfg) GetDailyList ¶
GetDailyList : Fetch all daily metrics
func (Dbcfg) GetExceptions ¶
GetExceptions - Return list of AppShadows
func (Dbcfg) GetMonthlyList ¶
GetMonthlyList : retrieve previous month's metrics
func (Dbcfg) PushException ¶
PushException : Insert exception instance
func (Dbcfg) PushMonthly ¶
PushMonthly : Insert new month instance
func (Dbcfg) UpdateDailyList ¶
UpdateDailyList : Update daily metric list for app
Click to show internal directories.
Click to hide internal directories.