diff options
author | Roeland Douma <rullzer@users.noreply.github.com> | 2016-05-17 15:53:49 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-05-17 15:53:49 +0200 |
commit | 90a290afd8415a8a89d72d5b4cb07988d29d7037 (patch) | |
tree | 173ee6e0e4cae96c92e79168aaa226ee90ec14ff /lib/public/Diagnostics | |
parent | 499f0e487dbc23de26a55f5459312295955fb567 (diff) | |
download | nextcloud-server-90a290afd8415a8a89d72d5b4cb07988d29d7037.tar.gz nextcloud-server-90a290afd8415a8a89d72d5b4cb07988d29d7037.zip |
Move \OCP\Diagnostics to PSR-4 (#24667)
Diffstat (limited to 'lib/public/Diagnostics')
-rw-r--r-- | lib/public/Diagnostics/IEvent.php | 61 | ||||
-rw-r--r-- | lib/public/Diagnostics/IEventLogger.php | 63 | ||||
-rw-r--r-- | lib/public/Diagnostics/IQuery.php | 49 | ||||
-rw-r--r-- | lib/public/Diagnostics/IQueryLogger.php | 53 |
4 files changed, 226 insertions, 0 deletions
diff --git a/lib/public/Diagnostics/IEvent.php b/lib/public/Diagnostics/IEvent.php new file mode 100644 index 00000000000..a3e42ee137f --- /dev/null +++ b/lib/public/Diagnostics/IEvent.php @@ -0,0 +1,61 @@ +<?php +/** + * @author Morris Jobke <hey@morrisjobke.de> + * @author Robin Appelman <icewind@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\Diagnostics; + +/** + * Interface IEvent + * + * @package OCP\Diagnostics + * @since 8.0.0 + */ +interface IEvent { + /** + * @return string + * @since 8.0.0 + */ + public function getId(); + + /** + * @return string + * @since 8.0.0 + */ + public function getDescription(); + + /** + * @return float + * @since 8.0.0 + */ + public function getStart(); + + /** + * @return float + * @since 8.0.0 + */ + public function getEnd(); + + /** + * @return float + * @since 8.0.0 + */ + public function getDuration(); +} diff --git a/lib/public/Diagnostics/IEventLogger.php b/lib/public/Diagnostics/IEventLogger.php new file mode 100644 index 00000000000..34e521db10c --- /dev/null +++ b/lib/public/Diagnostics/IEventLogger.php @@ -0,0 +1,63 @@ +<?php +/** + * @author Morris Jobke <hey@morrisjobke.de> + * @author Robin Appelman <icewind@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\Diagnostics; + +/** + * Interface IEventLogger + * + * @package OCP\Diagnostics + * @since 8.0.0 + */ +interface IEventLogger { + /** + * Mark the start of an event + * + * @param string $id + * @param string $description + * @since 8.0.0 + */ + public function start($id, $description); + + /** + * Mark the end of an event + * + * @param string $id + * @since 8.0.0 + */ + public function end($id); + + /** + * @param string $id + * @param string $description + * @param float $start + * @param float $end + * @since 8.0.0 + */ + public function log($id, $description, $start, $end); + + /** + * @return \OCP\Diagnostics\IEvent[] + * @since 8.0.0 + */ + public function getEvents(); +} diff --git a/lib/public/Diagnostics/IQuery.php b/lib/public/Diagnostics/IQuery.php new file mode 100644 index 00000000000..3b4d1b4c965 --- /dev/null +++ b/lib/public/Diagnostics/IQuery.php @@ -0,0 +1,49 @@ +<?php +/** + * @author Morris Jobke <hey@morrisjobke.de> + * @author Robin Appelman <icewind@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\Diagnostics; + +/** + * Interface IQuery + * + * @package OCP\Diagnostics + * @since 8.0.0 + */ +interface IQuery { + /** + * @return string + * @since 8.0.0 + */ + public function getSql(); + + /** + * @return array + * @since 8.0.0 + */ + public function getParams(); + + /** + * @return float + * @since 8.0.0 + */ + public function getDuration(); +} diff --git a/lib/public/Diagnostics/IQueryLogger.php b/lib/public/Diagnostics/IQueryLogger.php new file mode 100644 index 00000000000..285a85efde1 --- /dev/null +++ b/lib/public/Diagnostics/IQueryLogger.php @@ -0,0 +1,53 @@ +<?php +/** + * @author Morris Jobke <hey@morrisjobke.de> + * @author Robin Appelman <icewind@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\Diagnostics; + +use Doctrine\DBAL\Logging\SQLLogger; + +/** + * Interface IQueryLogger + * + * @package OCP\Diagnostics + * @since 8.0.0 + */ +interface IQueryLogger extends SQLLogger { + /** + * @param string $sql + * @param array $params + * @param array $types + * @since 8.0.0 + */ + public function startQuery($sql, array $params = null, array $types = null); + + /** + * @return mixed + * @since 8.0.0 + */ + public function stopQuery(); + + /** + * @return \OCP\Diagnostics\IQuery[] + * @since 8.0.0 + */ + public function getQueries(); +} |