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

[feature request] display last posted datetime per line #494

Closed FeLvi-zzz closed 4 months ago

FeLvi-zzz commented 9 months ago

Is your feature request related to a problem? Please describe. I can recognize how many a line executed, but I cannot recognize when the line executed.

Describe the solution you'd like like this, displaying last posted datetime per line. "last posted time" is not "last executed time" precisely, but I think it is useful information. image PoC: https://github.com/FeLvi-zzz/coverband/pull/1

what do you think?

Describe alternatives you've considered none for now

Additional context none

nevinera commented 8 months ago

@danmayer - I came here to make this exact request. Right now the only way to tell if something becomes unused is to reset the data and wait. But there are plenty of infrequently used features, so you often need to wait a month or so before you can be confident that any given bit of code is actually dead and removable. That makes the debriding cycle time very long.

If we were able to track the rough last-executed time (or even just date) for each line (and that would likely need to be a configurable option, since it would require more memory), we could just leave it running, and we'd always be able to look at code and see if it's dead. The coverage statistics wouldn't really help us, since things that were run a year ago would be listed as 'covered', but I can imagine evolutions of behavior to resolve that as well, later :-)

It looks like they've got a working implementation (supporting only redis hash store), but I'd be happy to put in some extra time to make this a configurable behavior, and support it in additional stores.

danmayer commented 7 months ago

yeah this feature exists in a coverband service that we never really ended up launching.... I guess there is a fork with it merged, I can take a look at that and perhaps pull it into all the implementations.

danmayer commented 4 months ago

OK, this is in the 6.1.0 release, I still only have it in the HashRedis adapter, but it should surface in the web admin reporting tool.

take a look @nevinera and thanks so much @FeLvi-zzz I pulled your code in just fixing up some merge conflicts