Blame view

src/vendor/1.2.5/Phalcon/Db/Profiler.php 2.08 KB
1ea3b987   Administrator   maby first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
  <?php 
  
  namespace Phalcon\Db {
  
  	/**
  	 * Phalcon\Db\Profiler
  	 *
  	 * Instances of Phalcon\Db can generate execution profiles
  	 * on SQL statements sent to the relational database. Profiled
  	 * information includes execution time in miliseconds.
  	 * This helps you to identify bottlenecks in your applications.
  	 *
  	 *<code>
  	 *
  	 *	$profiler = new Phalcon\Db\Profiler();
  	 *
  	 *	//Set the connection profiler
  	 *	$connection->setProfiler($profiler);
  	 *
  	 *	$sql = "SELECT buyer_name, quantity, product_name
  	 *	FROM buyers LEFT JOIN products ON
  	 *	buyers.pid=products.id";
  	 *
  	 *	//Execute a SQL statement
  	 *	$connection->query($sql);
  	 *
  	 *	//Get the last profile in the profiler
  	 *	$profile = $profiler->getLastProfile();
  	 *
  	 *	echo "SQL Statement: ", $profile->getSQLStatement(), "\n";
  	 *	echo "Start Time: ", $profile->getInitialTime(), "\n";
  	 *	echo "Final Time: ", $profile->getFinalTime(), "\n";
  	 *	echo "Total Elapsed Time: ", $profile->getTotalElapsedSeconds(), "\n";
  	 *
  	 *</code>
  	 *
  	 */
  	
  	class Profiler {
  
  		protected $_allProfiles;
  
  		protected $_activeProfile;
  
  		protected $_totalSeconds;
  
  		/**
  		 * Starts the profile of a SQL sentence
  		 *
  		 * @param string $sqlStatement
  		 * @return \Phalcon\Db\Profiler
  		 */
  		public function startProfile($sqlStatement){ }
  
  
  		/**
  		 * Stops the active profile
  		 *
  		 * @return \Phalcon\Db\Profiler
  		 */
  		public function stopProfile(){ }
  
  
  		/**
  		 * Returns the total number of SQL statements processed
  		 *
  		 * @return integer
  		 */
  		public function getNumberTotalStatements(){ }
  
  
  		/**
  		 * Returns the total time in seconds spent by the profiles
  		 *
  		 * @return double
  		 */
  		public function getTotalElapsedSeconds(){ }
  
  
  		/**
  		 * Returns all the processed profiles
  		 *
  		 * @return \Phalcon\Db\Profiler\Item[]
  		 */
  		public function getProfiles(){ }
  
  
  		/**
  		 * Resets the profiler, cleaning up all the profiles
  		 *
  		 * @return \Phalcon\Db\Profiler
  		 */
  		public function reset(){ }
  
  
  		/**
  		 * Returns the last profile executed in the profiler
  		 *
  		 * @return \Phalcon\Db\Profiler\Item
  		 */
  		public function getLastProfile(){ }
  
  	}
  }