4 use Psr\Log\LoggerInterface;
9 $logger->expects( $this->exactly( 3 ) )->method(
'info' );
12 $tp->setLogger( $logger );
13 $tp->setExpectation(
'maxAffected', 100, __METHOD__ );
15 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
16 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 3,
true, 200 );
17 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 3,
true, 200 );
18 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 1, 400 );
24 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
27 $tp->setLogger( $logger );
28 $tp->setExpectation(
'readQueryTime', 5, __METHOD__ );
30 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
31 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 10,
false, 1 );
32 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 10,
false, 1 );
33 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 0, 0 );
39 $logger->expects( $this->exactly( 4 ) )->method(
'info' );
42 $tp->setLogger( $logger );
43 $tp->setExpectation(
'writeQueryTime', 5, __METHOD__ );
45 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
46 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 10,
true, 1 );
47 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 10,
true, 1 );
48 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 20, 1 );
53 $logger->expects( $this->exactly( 1 ) )->method(
'info' );
56 $tp->setLogger( $logger );
57 $tp->setExpectation(
'maxAffected', 100, __METHOD__ );
59 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
60 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 1, 200 );
66 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
69 $tp->setLogger( $logger );
70 $tp->setExpectation(
'writeQueryTime', 5, __METHOD__ );
72 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
73 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 10, 1 );
78 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
81 $tp->setLogger( $logger );
82 $tp->setExpectation(
'conns', 2, __METHOD__ );
84 $tp->recordConnection(
'srv1',
'db1',
false );
85 $tp->recordConnection(
'srv1',
'db2',
false );
86 $tp->recordConnection(
'srv1',
'db3',
false );
87 $tp->recordConnection(
'srv1',
'db4',
false );
92 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
95 $tp->setLogger( $logger );
96 $tp->setExpectation(
'masterConns', 2, __METHOD__ );
98 $tp->recordConnection(
'srv1',
'db1',
false );
99 $tp->recordConnection(
'srv1',
'db2',
false );
101 $tp->recordConnection(
'srv1',
'db1',
true );
102 $tp->recordConnection(
'srv1',
'db2',
true );
103 $tp->recordConnection(
'srv1',
'db3',
true );
104 $tp->recordConnection(
'srv1',
'db4',
true );
109 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
112 $tp->setLogger( $logger );
113 $tp->setExpectation(
'queries', 2, __METHOD__ );
115 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 0.01,
false, 0 );
116 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 0.01,
false, 0 );
117 $tp->recordQueryCompletion(
"SQL 3", microtime(
true ) - 0.01,
false, 0 );
118 $tp->recordQueryCompletion(
"SQL 4", microtime(
true ) - 0.01,
false, 0 );
123 $logger->expects( $this->exactly( 2 ) )->method(
'info' );
126 $tp->setLogger( $logger );
127 $tp->setExpectation(
'writes', 2, __METHOD__ );
129 $tp->recordQueryCompletion(
"SQL 1", microtime(
true ) - 0.01,
false, 0 );
130 $tp->recordQueryCompletion(
"SQL 2", microtime(
true ) - 0.01,
false, 0 );
131 $tp->recordQueryCompletion(
"SQL 3", microtime(
true ) - 0.01,
false, 0 );
132 $tp->recordQueryCompletion(
"SQL 4", microtime(
true ) - 0.01,
false, 0 );
134 $tp->transactionWritingIn(
'srv1',
'db1',
'123' );
135 $tp->recordQueryCompletion(
"SQL 1w", microtime(
true ) - 0.01,
true, 2 );
136 $tp->recordQueryCompletion(
"SQL 2w", microtime(
true ) - 0.01,
true, 5 );
137 $tp->recordQueryCompletion(
"SQL 3w", microtime(
true ) - 0.01,
true, 3 );
138 $tp->recordQueryCompletion(
"SQL 4w", microtime(
true ) - 0.01,
true, 1 );
139 $tp->transactionWritingOut(
'srv1',
'db1',
'123', 1, 1 );