Documentation ¶
Overview ¶
Package monup is an experiment in augmenting MongoDB data by tailing the oplog. In this case, we're computing statistiacal rollups of data.
There are two main processes to run: `marker` and `roller`. Marker tails the oplog so that new datapoint inserts mark the rollup values they effect to be computed. Roller computes those rollups.
This is an experiment and probably shouldn't be used in production.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatapointsToFloats ¶
DatapointsToFloats lets us work with a natural slice of floats
Types ¶
type Datapoint ¶
type Datapoint struct {
Value float64 `bson:"value"`
}
Datapoint exists to ease parsing out of MongoDB
type Marker ¶
type Marker struct { Sess *mgo.Session Namespace string Over []time.Duration TriggerNamespace string }
Marker encapsulates the logic for running a marker
type Oplog ¶
type Oplog struct { Timestamp bson.MongoTimestamp `bson:"ts"` HistoryID int64 `bson:"h"` MongoVersion int `bson:"v"` Operation string `bson:"op"` Namespace string `bson:"ns"` Object bson.Raw `bson:"o"` QueryObject bson.Raw `bson:"o2"` }
Oplog is a document returned by tailing the replication log
func LatestOplog ¶
LatestOplog returns the most recent oplog from the database
type Roller ¶
type Roller struct { Sess *mgo.Session Namespace string TriggerNamespace string Period time.Duration }
Roller polls for triggers and calculated rollups
type Rollup ¶
type Rollup struct { Name string `bson:"name"` At time.Time `bson:"at"` Min float64 `bson:"min"` P2 float64 `bson:"p2"` P9 float64 `bson:"p9"` P25 float64 `bson:"p25"` P50 float64 `bson:"p50"` P75 float64 `bson:"p75"` P91 float64 `bson:"p91"` P98 float64 `bson:"p98"` Max float64 `bson:"max"` }
Rollup is an object stored into a rollup collection