def _get_feature_metrics(
        self,
    ) -> dict[EnvMetricsName, Callable[[], int]]:
        """
        Returns callables that counts the total number and enabled count of features for the environment.
        """
        features_qs = self.environment.get_features_metrics_queryset()

        features_aggregation_result: dict[str, int] = features_qs.aggregate(
            total=models.Count("id"),
            enabled=models.Count("id", filter=Q(enabled=True)),
        )
        return {
            EnvMetricsName.TOTAL_FEATURES: lambda: features_aggregation_result["total"],
            EnvMetricsName.ENABLED_FEATURES: lambda: features_aggregation_result[
                "enabled"
            ],
        }

        Returns callables that counts the total number and enabled count of features for the environment.
        
api/metrics/metrics_service.py