Feature request: Filter stats by package
See original GitHub issueHi there,
It would be lovely to filter stats by package. Because you’re using PyObject_RichCompareBool
as part of the filter it’s already possible to achieve this with a helper object. Would you be interested in integrating this as a feature with a stable API?
My current implementation is:
import dataclasses
import importlib
import os
@dataclasses.dataclass
class PackageModule:
package: str
def __post_init__(self):
mod = importlib.import_module(self.package)
self.fn = mod.__file__
if self.fn.endswith("__init__.py"):
self.fn = os.path.dirname(self.fn)
def __eq__(self, other):
return other.startswith(self.fn)
yappi.get_func_stats(filter={"modname": PackageModule("apd.aggregation")}).print_all()
There are caveats to this, mainly that it requires the module to be importable, and not undesirable to import (such as potential import-time side-effects), but I think it improves the usability a fair bit.
What do you think? If you’re interested I’m happy to put together a PR.
Matt
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Allow to filter environment in Organization Stats · Issue #9141 ...
My product, Sleuth, integrates with Sentry to pull down error counts, but because this feature is missing both here and for project stats,...
Read more >Filtering Stats iQ Data - Qualtrics
From the dropdown menu, choose the variable that you would like to base the filter on. Variable dropdown list in filter; Select an...
Read more >Inverse statistics? (maybe feature request) :: Dyson Sphere ...
The most efficient way that I know of to find them is to go into the statistics panel, select them as a favorite,...
Read more >Filter Feature Requests by Customer Attributes - Savio
With Savio, you can filter your feature requests by these attributes. This is an extremely powerful feature. Because you know that not all...
Read more >Video: Sort, filter, summarize, and calculate your PivotTable data
Training: You can analyze PivotTable data in many ways, including sorting to quickly see trends. We'll also look at how to filter, summarize...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We have a new API param for this
filter_callback
inget_func_stats()
.Here is an example from the docs:
Thanks, I’ll update the example code and docs I wrote.