• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /5.5.2/goproj/src/github.com/couchbase/indexing/secondary/queryport/client/

Lines Matching defs:cp

66 	cp := newConnectionPool(host, 3, 6, 1024*1024, readDeadline, writeDeadline, 3, 1)
67 cp.mkConn = testMkConn
73 sc, err = cp.Get()
82 cp.Return(k, true)
85 err = cp.Close()
90 cp.Close()
109 cp := newConnectionPool(host, 500, 10, 1024*1024, readDeadline, writeDeadline, 40, 10)
110 cp.mkConn = testMkConn
117 sc, err := cp.Get()
127 cp.Return(k, true)
136 if cp.freeConns != 220 {
137 t.Errorf("Warning! cp.freeConns is not 220, its %d", cp.freeConns)
142 if cp.freeConns != 200 {
143 t.Errorf("Warning! cp.freeConns is not 200, its %d", cp.freeConns)
148 if cp.freeConns != 180 {
149 t.Errorf("Warning! cp.freeConns is not 180, its %d", cp.freeConns)
154 if cp.freeConns != 160 {
155 t.Errorf("Warning! cp.freeConns is not 160, its %d", cp.freeConns)
159 cp.Return(l, true)
163 cp.Close()
182 cp := newConnectionPool(host, 500, 10, 1024*1024, readDeadline, writeDeadline, 40, 10)
183 cp.mkConn = testMkConn
190 sc, err := cp.Get()
204 cp.Return(k, true)
214 sc, err := cp.Get()
223 if cp.freeConns > 20 {
224 t.Errorf("Warning! cp.freeConns is greater than 20, its %d", cp.freeConns)
229 cp.Return(l, true)
233 cp.Close()
241 func startAllocatorRoutine(cp *connectionPool, ch chan *connection, stopCh chan bool) {
252 if cp.curActConns < 200 {
259 conn, err := cp.Get()
266 if cp.curActConns > 250 {
267 errmsg := fmt.Sprintf("ERROR: TOO MANY ACTIVE CONNS %v", cp.curActConns)
274 func startDeallocatorRoutine(cp *connectionPool, ch chan *connection, stopCh chan bool) {
288 cp.Return(conn, true)
305 cp := newConnectionPool(host, 500, 10, 1024*1024, readDeadline, writeDeadline, 40, 10)
306 cp.mkConn = testMkConn
312 go startAllocatorRoutine(cp, ch, stopCh)
313 go startDeallocatorRoutine(cp, ch, stopCh)
317 fmt.Println("cp.curActConns =", cp.curActConns)
326 cp.Return(connectn, true)
329 cp.Close()
348 cp := newConnectionPool(host, 20, 5, 1024*1024, readDeadline, writeDeadline, 10, 2)
349 cp.mkConn = testMkConn
354 sc, err := cp.Get()
363 cp.Return(k, true)
366 if cp.freeConns != 12 {
367 t.Errorf("Expected value fo freeConns = 12, actual = %v", cp.freeConns)
373 if cp.freeConns < 10 {
374 msg := fmt.Sprintf("freeConns (%v) went below low WM", cp.freeConns)
380 cp.Return(l, true)
384 cp.Close()
403 cp := newConnectionPool(host, 120, 5, 1024*1024, readDeadline, writeDeadline, 10, 10)
404 cp.mkConn = testMkConn
411 sc, err := cp.Get()
421 cp.Return(k, true)
428 if cp.freeConns != 20 {
429 t.Errorf("Expected value for freeConns = 20, actual = %v", cp.freeConns)
432 if cp.curActConns != 80 {
433 t.Errorf("Expected value fo curActConns = 80, actual = %v", cp.curActConns)
439 if cp.freeConns != 10 {
440 t.Errorf("Expected value for freeConns = 10, actual = %v", cp.freeConns)
446 cp.Return(k, true)
453 if cp.freeConns != 30 {
454 t.Errorf("Expected value for freeConns = 30, actual = %v", cp.freeConns)
457 if cp.curActConns != 60 {
458 t.Errorf("Expected value fo curActConns = 60, actual = %v", cp.curActConns)
464 if cp.freeConns != 20 {
465 t.Errorf("Expected value for freeConns = 20, actual = %v", cp.freeConns)
468 cp.Close()
487 cp := newConnectionPool(host, 40, 5, 1024*1024, readDeadline, writeDeadline, 2, 2)
488 cp.mkConn = testMkConn
496 sc, err := cp.Get()
504 cp.Return(k, true)
510 numRetConns, needToFreeConns := cp.numConnsToRetain()
513 fmt.Printf("freeConns = %v, curActConns = %v, rate = %v\n", cp.freeConns, cp.curActConns, cp.ewma.Rate())
518 fmt.Printf("freeConns = %v, curActConns = %v, rate = %v\n", cp.freeConns, cp.curActConns, cp.ewma.Rate())
524 sc, err := cp.Get()
532 cp.Return(k, true)
538 numRetConns, needToFreeConns = cp.numConnsToRetain()
541 fmt.Printf("freeConns = %v, curActConns = %v, rate = %v\n", cp.freeConns, cp.curActConns, cp.ewma.Rate())
546 fmt.Printf("freeConns = %v, curActConns = %v, rate = %v\n", cp.freeConns, cp.curActConns, cp.ewma.Rate())
549 cp.Close()