LCOV - code coverage report
Current view: top level - source/extensions/retry/host/previous_hosts - previous_hosts.h (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 0 7 0.0 %
Date: 2024-01-05 06:35:25 Functions: 0 2 0.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include "envoy/upstream/retry.h"
       4             : #include "envoy/upstream/upstream.h"
       5             : 
       6             : namespace Envoy {
       7             : class PreviousHostsRetryPredicate : public Upstream::RetryHostPredicate {
       8             : public:
       9           0 :   bool shouldSelectAnotherHost(const Upstream::Host& candidate_host) override {
      10           0 :     return std::find(attempted_hosts_.begin(), attempted_hosts_.end(), &candidate_host) !=
      11           0 :            attempted_hosts_.end();
      12           0 :   }
      13           0 :   void onHostAttempted(Upstream::HostDescriptionConstSharedPtr attempted_host) override {
      14           0 :     attempted_hosts_.emplace_back(attempted_host.get());
      15           0 :   }
      16             : 
      17             : private:
      18             :   std::vector<Upstream::HostDescription const*> attempted_hosts_;
      19             : };
      20             : } // namespace Envoy

Generated by: LCOV version 1.15