Closed simPod closed 1 year ago
disabling sort reduced the scrape duration by half
Hey @simPod,
good catch! I'm thinking of don't sort it per default. What do you think? Of course, this would be a bit different from what the other libs do (go/python) however it seems the sorting there is more efficient.
Yup but that would be BC. We can introduce this flag and flip the default value in next major? Your call.
Thank you!
Hello!
Yup but that would be BC. We can introduce this flag and flip the default value in next major? Your call.
I think it's still BC for any class which implements RegistryInterface
. Use cases like mocks or wrappers.
After the latest minor release I am having this error:
PHP Fatal error: Declaration of Javespi\MyCollectorRegistry::getMetricFamilySamples(): array must be compatible with Prometheus\RegistryInterface::getMetricFamilySamples(bool $sortMetrics = true): array
I think the only way of being BC is removing the type hint of the argument. I'll try to create a pull-request with a hotfix for this.
Edit: Reported as issue here https://github.com/PromPHP/prometheus_client_php/issues/117 Edit 2: Pull request to avoid BC here https://github.com/PromPHP/prometheus_client_php/pull/118
This function does 50 % of a loading time (using inmemory adapter) so I'd like to be able to disable it.