danmayer / coverband

Ruby production code coverage collection and reporting (line of code usage)
https://github.com/danmayer/coverband
MIT License
2.46k stars 157 forks source link

Add memcached adapter #517

Closed prastamaha closed 5 months ago

prastamaha commented 6 months ago

Description

This pull request introduces a new adapter for Coverband, enabling the use of Memcached as a storage backend. This addition allows users of Coverband to leverage the distributed memory object caching system, which can be particularly useful for applications that are already using Memcached for other forms of caching. This can help in maintaining consistency in the tools used across an application and can potentially improve performance for coverage data storage and retrieval.

Changes

Usage

To use the Memcached adapter, users need to initialize it with a Memcached client instance and optionally specify a namespace for the keys. This flexibility allows for easy integration into existing projects that might already be using Memcached.

Coverband.configure do |config|
    memcached = Memcached.new([...])
    config.store = Coverband::Adapters::MemcachedStore.new(memcached, memcached_namespace: 'my_app_coverband')

    config.track_views = false
end

Notes

Unsupported Operations: raw_store and migrate

danmayer commented 6 months ago

Nice, adding memcache support has been on my list for awhile now. I will take a closer look and likely pull this in... I have more been moving towards implementing a generic active support cache store adapter for Coverband which would allow folks to configure anything active support cache supports to use with Coverband.

danmayer commented 5 months ago

I am looking to get this integrated as it is taking me way longer to wrap up my other PR and I won't get to the active support adapter that soon.

danmayer commented 5 months ago

thanks so much @prastamaha I am so sorry it took me so long to get back to you on this