IDataCollector.php 731 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\DataCollector;
  8. use OC\AppFramework\Http\Request;
  9. use OCP\AppFramework\Http\Response;
  10. /**
  11. * DataCollectorInterface.
  12. *
  13. * @since 24.0.0
  14. */
  15. interface IDataCollector {
  16. /**
  17. * Collects data for the given Request and Response.
  18. * @since 24.0.0
  19. */
  20. public function collect(Request $request, Response $response, ?\Throwable $exception = null): void;
  21. /**
  22. * Reset the state of the profiler.
  23. * @since 24.0.0
  24. */
  25. public function reset(): void;
  26. /**
  27. * Returns the name of the collector.
  28. * @since 24.0.0
  29. */
  30. public function getName(): string;
  31. }