copy wangle back into folly
[folly.git] / folly / wangle / ssl / SSLStats.h
1 /*
2  *  Copyright (c) 2015, Facebook, Inc.
3  *  All rights reserved.
4  *
5  *  This source code is licensed under the BSD-style license found in the
6  *  LICENSE file in the root directory of this source tree. An additional grant
7  *  of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11
12 namespace folly {
13
14 class SSLStats {
15  public:
16   virtual ~SSLStats() noexcept {}
17
18   // downstream
19   virtual void recordSSLAcceptLatency(int64_t latency) noexcept = 0;
20   virtual void recordTLSTicket(bool ticketNew, bool ticketHit) noexcept = 0;
21   virtual void recordSSLSession(bool sessionNew, bool sessionHit, bool foreign)
22     noexcept = 0;
23   virtual void recordSSLSessionRemove() noexcept = 0;
24   virtual void recordSSLSessionFree(uint32_t freed) noexcept = 0;
25   virtual void recordSSLSessionSetError(uint32_t err) noexcept = 0;
26   virtual void recordSSLSessionGetError(uint32_t err) noexcept = 0;
27   virtual void recordClientRenegotiation() noexcept = 0;
28
29   // upstream
30   virtual void recordSSLUpstreamConnection(bool handshake) noexcept = 0;
31   virtual void recordSSLUpstreamConnectionError(bool verifyError) noexcept = 0;
32   virtual void recordCryptoSSLExternalAttempt() noexcept = 0;
33   virtual void recordCryptoSSLExternalConnAlreadyClosed() noexcept = 0;
34   virtual void recordCryptoSSLExternalApplicationException() noexcept = 0;
35   virtual void recordCryptoSSLExternalSuccess() noexcept = 0;
36   virtual void recordCryptoSSLExternalDuration(uint64_t duration) noexcept = 0;
37   virtual void recordCryptoSSLLocalAttempt() noexcept = 0;
38   virtual void recordCryptoSSLLocalSuccess() noexcept = 0;
39
40 };
41
42 }