示例#1
0
func NewActivePool(queryTimeout, idleTimeout time.Duration) *ActivePool {
	return &ActivePool{
		pool:     pools.NewNumbered(),
		timeout:  int64(queryTimeout),
		connPool: NewConnectionPool(1, idleTimeout),
		ticks:    timer.NewTimer(idleTimeout / 10),
	}
}
示例#2
0
func NewActiveTxPool(timeout time.Duration) *ActiveTxPool {
	return &ActiveTxPool{
		pool:    pools.NewNumbered(),
		lastId:  time.Now().UnixNano(),
		timeout: int64(timeout),
		ticks:   timer.NewTimer(timeout / 10),
		txStats: stats.NewTimings("Transactions"),
	}
}
示例#3
0
func NewSchemaInfo(queryCacheSize int, schemaReloadTime time.Duration) *SchemaInfo {
	self := &SchemaInfo{
		QueryCacheSize:   queryCacheSize,
		SchemaReloadTime: schemaReloadTime,
		ticks:            timer.NewTimer(schemaReloadTime),
	}
	http.Handle("/debug/query_cache", self)
	return self
}