문제

By default, the Symfony2 profiler only saves a few* of the last requests (Don't know how many excactly - something between 25 and 40). I think the list removes the older ones after a cupple of minutes..

I'd like to do a long-time profiling and measuring of some data. Is it possible to configure the max profiling amount? Or maybe store all the data in my (MongoDB) Database? (I'm currently using Symfony 2.2)

Update: I found out, that clearing the cache, also clears the profiler data - so I guess the key issue here is, to save the profiler data somewhere else..

도움이 되었습니까?

해결책

Check this out.

You can override the default profiler.storage service, which is defined here.

You could either define your own class (implementing the ProfilerStorageInterface) or use one of the provided implementations (check here for the whole list).

For example if you want to use the MongoDbProfilerStorage you can redefine the service as follows:

<service id="profiler.storage" class="Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage" public="false">
    <argument>mongodb://[USER:PWD@]HOST/DATABASE/COLLECTION</argument>
    <argument></argument>
    <argument></argument>
    <argument>86400</argument>
</service>

This way you wouldn't delete profiler data whenever you clear the cache.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top