问题
How does Glimpse persist collected data? Is it all saved in memory? Is there a way to persist the data in a database?
I ask this because if I have a website installed on multiple machines (load balancing) can I use glimpse for debugging, or is the data collected from one server not accessible from other servers?
回答1:
IPersistenceStore is the interface to implement.
Glimpse ships out of the box with an in memory store called ApplicationPersistenceStore, but your implementation could write the data to a database, filesystem, distributed cache - whatever meets your needs.
To wire your implementation into Glimpse, you'll need to create an IServiceLocator and configure Glimpse to use it via the serviceLocatorType
attribute on the glimpse
node in web.config
.
If you'd like to see a sample IServiceLocator
implementation, you can take a look at AspNetServiceLocator.
回答2:
From looking at the History tab page I suspect the documentation has yet to be written, it currently says this:
Persistense Store
TODO: Link to example of how to update
IPersistenseStore
.
I've looked through the code and cannot find a IPersistenseStore
interface. But I can find the IDataStore interface which is where I suggest you start looking.
There currently appears to be two implementations of the interface, the DictionaryDataStoreAdapter class and the HttpApplicationStateBaseDataStoreAdapter class.
Update
There is an IPersistenceStore interface which is implemented by the ApplicationPersistenceStore class. Though this class seems to defer to a IDataStore, so that's probably still the place to look to implement a custom solution.
来源:https://stackoverflow.com/questions/16198195/how-glimpse-persists-debugging-information