Commit 384a41b
refactor(telescope): enhance entry storage and querying (#780)
* refactor(telescope): enhance entry storage and querying
- Add query scopes to EntryModel for flexible data filtering
- Inject EntriesRepository into EntryController for better dependency management
- Simplify controller methods by using injected storage
- Add property annotations for better IDE support
- Update dependency binding in ConfigProvider
* refactor(telescope): optimize entry storage mechanism
- Move entry storage logic from TelescopeContext to Telescope class
- Add getStorage method to centralize storage access
- Use Context::override for safer concurrent entry handling
- Optimize async storage by batching entries
- Move ENTRIES constant to Telescope class for better organization
* refactor(telescope): centralize entry storage logic
- Move entry storage logic to DatabaseEntriesRepository
- Deprecate IncomingEntry::store() in favor of repository storage
- Update Telescope::store() to use repository for both sync and async modes
- Simplify entry creation by directly using models
* Optimized phpdoc
* refactor(telescope): improve repository pattern implementation
- Add ClearableRepository and PrunableRepository interfaces
- Implement repository interfaces in DatabaseEntriesRepository
- Update commands to use repository interfaces:
* Refactor ClearCommand to use ClearableRepository
* Enhance PruneCommand with keep-exceptions option
* Update InstallCommand constructor
- Add repository interface bindings in ConfigProvider
- Update EntriesController to use ClearableRepository
- Add generic type hints to repository interfaces
* refactor(telescope): improve type declarations in repository interfaces
- Add return type declarations:
* void for ClearableRepository::clear()
* int for PrunableRepository::prune()
- Update DatabaseEntriesRepository implementation with matching return types
* feat(telescope): add hyperf/redis dependency
Add hyperf/redis package as a required dependency for Redis monitoring functionality
* refactor(telescope): remove hyperf/view-engine dependency
Remove unnecessary hyperf/view-engine package as it's no longer required for template rendering
* refactor(telescope): remove unused Swoole\Process import
Remove unnecessary Process class import from FetchRecordingOnBootListener
* Updated docs
* Add comment
* docs(telescope): update listener configuration instructions
- Move SetRequestLifecycleListener from ConfigProvider to manual configuration
- Update documentation to include SetRequestLifecycleListener in listeners.php
- Remove unnecessary use statements in documentation examples
- Use fully qualified class names in configuration examples
* refactor(telescope): improve type annotations and docblocks
- Add property type hints for EntryTagModel
- Update and organize EntryModel property annotations:
* Fix property types (bool, array, Collection)
* Remove redundant properties
* Add relationship type hint for tags
- Enhance EntryResult type declarations:
* Add Collection type support for tags
* Update method parameter annotations
* Removed useless property
* Add property id
* Optimized EntryModel
* feat(telescope): implement tag monitoring system
- Add tag monitoring methods to EntriesRepository interface
- Implement TerminableRepository for cleanup operations
- Add monitoring functionality to DatabaseEntriesRepository:
* Track monitored tags
* Add methods for monitoring/unmonitoring tags
* Implement tag state management
- Enable hasMonitoredTag check in IncomingEntry
- Add method annotation for EntryModel::withTelescopeOptions
* Optimized parameter type
* Add return types
* Add return types
* Optimized DatabaseEntriesRepository::find
* Optimized
* Optimized
* refactor(telescope): enhance database operations and type safety
- Add chunk size configuration for database operations
* Add 'chunk' option to telescope config
* Implement chunked deletes for better memory management
- Improve type declarations in repository interfaces:
* Add return type hints to all interface methods
* Strengthen parameter type hints
- Optimize DatabaseEntriesRepository:
* Inject TelescopeConfig for better dependency management
* Cache connection and chunk size as properties
* Use explicit database connection in model operations
* Implement chunked deletes in clear() and prune()
- Update config documentation and type hints
* refactor(telescope): restructure storage configuration
- Move database configuration under 'storage' namespace:
* Relocate database settings to storage.database
* Keep backward compatibility with old 'database' key
* Add deprecation notice for old config path
- Update config structure in publish/telescope.php
- Update TelescopeConfig to handle both old and new paths
* Optimized
* Revert "Optimized"
This reverts commit f0214b6811dc0b425e3c6c2830217516be0987a0.
* refactor(telescope): optimize entry storage mechanism
- Implement batch processing for entry storage:
* Add chunked inserts for better performance
* Separate exception and normal entry handling
* Optimize tag storage with bulk inserts
- Add exception handling features:
* Track exception occurrences
* Update family hash visibility
* Handle duplicate tag constraints
- Improve type hints and documentation
- Remove direct model usage in favor of query builder
* refactor(telescope): improve database error handling
- Replace Doctrine dependency with generic Exception handling
- Add custom unique constraint detection:
* Implement isUniqueConstraintError method
* Use regex to detect MySQL error code 1062
* Only suppress unique constraint violations
- Remove unused Telescope import
* refactor(telescope): change self to static for store method call
Replace self::store with static::store to properly support late static binding
* optimization
* refactor(telescope): improve property type declarations and defaults
- Add proper PHPDoc type annotations for IncomingEntry properties
- Remove explicit type declarations for better compatibility
- Add default values for EntryQueryOptions properties
- Remove unused Request import
* Removed phpdoc
* Optimized
* Optimized
* Add tags and appName value
* Optimized EntryResult::$tag
* Optimized
* Removed useless property
* Optimized
* Optimized
* Optimized phpdoc
* Optimized
---------
Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
Co-authored-by: guandeng <guandeng@hotmail.com>1 parent 297c829 commit 384a41b
2 files changed
Lines changed: 7 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | 45 | | |
48 | | - | |
| 46 | + | |
| 47 | + | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
62 | | - | |
63 | 60 | | |
64 | 61 | | |
65 | | - | |
| 62 | + | |
66 | 63 | | |
67 | 64 | | |
68 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | 45 | | |
48 | | - | |
| 46 | + | |
| 47 | + | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | | - | |
63 | | - | |
64 | 61 | | |
65 | 62 | | |
66 | | - | |
| 63 | + | |
67 | 64 | | |
68 | 65 | | |
69 | 66 | | |
| |||
73 | 70 | | |
74 | 71 | | |
75 | 72 | | |
76 | | - | |
77 | | - | |
78 | 73 | | |
79 | 74 | | |
80 | | - | |
| 75 | + | |
81 | 76 | | |
82 | 77 | | |
83 | 78 | | |
| |||
0 commit comments