Documentation ¶
Index ¶
- Constants
- Variables
- func CloneDoc(doc bson.M) bson.M
- func CountLines(reader *bufio.Reader) (int, error)
- func Echo(doc bson.M)
- func GetDemoDoc() bson.M
- func GetDemoFromFile(filename string) string
- func GetDemoSchema() string
- func GetDocByTemplate(filename string, meta bool) (bson.M, error)
- func GetEmailAddress() string
- func GetRandomizedDoc(buf []byte, meta bool) (bson.M, error)
- func HTTPDigest(method string, uri string, username string, password string, ...) (*http.Response, error)
- func MilliToTimeString(milli float64) string
- func NewReader(file *os.File) (*bufio.Reader, error)
- func RandomizeDocument(doc *map[string]interface{}, f interface{}, meta bool)
- type FavoritesDoc
- type FavoritesSchema
- type LogInfo
- type OpPerformanceDoc
- type SlowOps
- type WaitGroup
Constants ¶
View Source
const COLLSCAN = "COLLSCAN"
COLLSCAN constance
Variables ¶
View Source
var Favorites = FavoritesDoc{ Sports: []string{"Baseball", "Boxing", "Dodgeball", "Figure skating", "Football", "Horse racing", "Mountaineering", "Skateboard", "Ski", "Soccer"}, Music: []string{"Blues", "Classical", "Country", "Easy Listening", "Electronic", "Hip Pop", "Jazz", "Opera", "Soul", "Rock"}, Cities: []string{"Atlanta", "Bangkok", "Beijing", "London", "Paris", "Singapore", "New York", "Istanbul", "Dubai", "Taipei"}, Books: []string{"Journey to the West", "The Lord of the Rings", "In Search of Lost Time", "Don Quixote", "Ulysses", "The Great Gatsby", "Moby Dick", "Hamlet", "War and Peace", "The Odyssey"}, Movies: []string{"The Godfather", "The Shawshank Redemption", "Schindler's List", "Raging Bull", "Casablanca", "Citizen Kane", "Gone with the Wind", "The Wizard of Oz", "One Flew Over the Cuckoo's Nest", "Lawrence of Arabia"}, }
Favorites constance
Functions ¶
func CountLines ¶
CountLines count number of '\n'
func GetDemoFromFile ¶
GetDemoFromFile returns a doc from a template
func GetDocByTemplate ¶
GetDocByTemplate returns a bson.M document
func GetRandomizedDoc ¶
GetRandomizedDoc returns a randomized doc from byte string
func HTTPDigest ¶ added in v1.1.0
func HTTPDigest(method string, uri string, username string, password string, headers map[string]string) (*http.Response, error)
HTTPDigest --digest
func MilliToTimeString ¶ added in v1.1.0
MilliToTimeString converts milliseconds to time string, e.g. 1.5m
func RandomizeDocument ¶
RandomizeDocument traverses a doc and replace values with random values according to their data type.
Types ¶
type FavoritesDoc ¶
type FavoritesDoc struct { Sports []string Music []string Cities []string Books []string Movies []string }
FavoritesDoc -
type FavoritesSchema ¶
type FavoritesSchema struct { ID string `json:"_id" bson:"_id"` FavoriteBook string `json:"favoriteBook" bson:"favoriteBook"` FavoriteCity string `json:"favoriteCity" bson:"favoriteCity"` FavoriteMovie string `json:"favoriteMovie" bson:"favoriteMovie"` FavoriteMusic string `json:"favoriteMusic" bson:"favoriteMusic"` FavoriteSport string `json:"favoriteSport" bson:"favoriteSport"` }
FavoritesSchema -
type LogInfo ¶
type LogInfo struct { OpsPatterns []OpPerformanceDoc OutputFilename string SlowOps []SlowOps // contains filtered or unexported fields }
LogInfo keeps loginfo struct
func (*LogInfo) SetCollscan ¶ added in v1.1.0
SetCollscan -
func (*LogInfo) SetVerbose ¶ added in v1.1.0
SetVerbose -
type OpPerformanceDoc ¶
type OpPerformanceDoc struct { Command string // count, delete, find, remove, and update Count int // number of ops Filter string // query pattern MaxMilli int // max millisecond Namespace string // database.collectin Scan string // COLLSCAN TotalMilli int // total milliseconds Index string // index used }
OpPerformanceDoc stores performance data
Click to show internal directories.
Click to hide internal directories.