Closed Johnmeurt closed 2 years ago
Merging #68 (0a9d527) into master (9966e12) will increase coverage by
3.38658%
. The diff coverage is94.02985%
.
@@ Coverage Diff @@
## master #68 +/- ##
=====================================================
+ Coverage 82.69231% 86.07889% +3.38658%
- Complexity 100 134 +34
=====================================================
Files 13 17 +4
Lines 312 431 +119
=====================================================
+ Hits 258 371 +113
- Misses 54 60 +6
Impacted Files | Coverage Δ | |
---|---|---|
StorageFactory/ApcFactory.php | 50.00000% <50.00000%> (ø) |
|
...njection/Compiler/ResolveAdapterDefinitionPass.php | 71.42857% <80.00000%> (-7.14286%) |
:arrow_down: |
StorageFactory/FactoryRegistry.php | 93.93939% <93.93939%> (ø) |
|
StorageFactory/RedisFactory.php | 94.73684% <94.73684%> (ø) |
|
DependencyInjection/Configuration.php | 97.47899% <96.36364%> (-0.95851%) |
:arrow_down: |
...cyInjection/ArtprimaPrometheusMetricsExtension.php | 100.00000% <100.00000%> (ø) |
|
StorageFactory/InMemoryFactory.php | 100.00000% <100.00000%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 9966e12...0a9d527. Read the comment docs.
This PR provides factories for the storage adapter. This allows evaluation of the adapter in runtime. With this internal update you can now:
To declare a custom adapter you should add a custom facotry and add the tag
prometheus_metrics_bundle.adapter_factory
. I also register the factory interface for auto configuration.The storage factory is designed to manage their own options. They should extract from array and cast if necessary their options and also manage default values before injection. I could change this parameter to a class to simplify the usage options (I don't know if this is relevant).
I change the configuration to move
type
andredis
under a new parameterstorage
and I deprecated those parameters. I add a variable parameterstorage.options
to allows additionnal parameters.The container will have a new parameter for debug
prometheus_metrics_bundle.storage
. The container parametersprometheus_metrics_bundle.type
andprometheus_metrics_bundle.redis
are still set for debug purpose but are not use anymore.I am not sure about the
storage
. It provides all known parameters for redis and apcu but I feel documentation could be enough. This means those parameters will move understorage.options
as variable parameters.I also add support of DSN. The value extract from the dsn will override the defined parameters. Here is a example: