1
#include "source/common/tls/stats.h"
2

            
3
#include "envoy/stats/scope.h"
4
#include "envoy/stats/stats_macros.h"
5

            
6
namespace Envoy {
7
namespace Extensions {
8
namespace TransportSockets {
9
namespace Tls {
10

            
11
7082
SslStats generateSslStats(Stats::Scope& store) {
12
7082
  std::string prefix("ssl.");
13
7082
  return {ALL_SSL_STATS(POOL_COUNTER_PREFIX(store, prefix), POOL_GAUGE_PREFIX(store, prefix),
14
7082
                        POOL_HISTOGRAM_PREFIX(store, prefix))};
15
7082
}
16

            
17
11180
Stats::Gauge& createCertificateExpirationGauge(Stats::Scope& scope, const std::string& cert_name) {
18
11180
  const std::string full_stat_name =
19
11180
      absl::StrCat("ssl.certificate.", cert_name, ".expiration_unix_time_seconds");
20

            
21
11180
  return Stats::Utility::gaugeFromElements(scope, {Stats::DynamicName(full_stat_name)},
22
11180
                                           Stats::Gauge::ImportMode::NeverImport);
23
11180
}
24

            
25
} // namespace Tls
26
} // namespace TransportSockets
27
} // namespace Extensions
28
} // namespace Envoy