proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
ByteEvents.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015-present, 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
#include <
proxygen/lib/http/session/ByteEvents.h
>
11
12
#include <
proxygen/lib/utils/Time.h
>
13
14
namespace
proxygen
{
15
16
const
char
*
const
kTypeStrings
[] = {
17
"FIRST_BYTE"
,
18
"LAST_BYTE"
,
19
"PING_REPLY_SENT"
,
20
"FIRST_HEADER_BYTE"
,
21
};
22
23
std::ostream&
operator<<
(std::ostream& os,
const
ByteEvent
& be) {
24
os << folly::to<std::string>(
25
"("
, kTypeStrings[be.
eventType_
],
", "
, be.
byteOffset_
,
")"
);
26
return
os;
27
}
28
29
int64_t
PingByteEvent::getLatency
() {
30
return
millisecondsSince
(
pingRequestReceivedTime_
).count();
31
}
32
33
}
// proxygen
proxygen::operator<<
std::ostream & operator<<(std::ostream &os, const HeaderTable &table)
Definition:
HeaderTable.cpp:254
proxygen::ByteEvent::eventType_
EventType eventType_
Definition:
ByteEvents.h:36
proxygen::PingByteEvent::getLatency
int64_t getLatency() override
Definition:
ByteEvents.cpp:29
Time.h
proxygen::ByteEvent
Definition:
ByteEvents.h:19
proxygen::ByteEvent::byteOffset_
uint64_t byteOffset_
Definition:
ByteEvents.h:38
proxygen::PingByteEvent::pingRequestReceivedTime_
TimePoint pingRequestReceivedTime_
Definition:
ByteEvents.h:108
proxygen::millisecondsSince
std::chrono::milliseconds millisecondsSince(std::chrono::time_point< ClockType > t)
Definition:
Time.h:101
proxygen
Definition:
ExMessageHandler.h:14
ByteEvents.h
int64_t
int64_t
Definition:
ConstexprMathBenchmark.cpp:188
proxygen::kTypeStrings
const char *const kTypeStrings[]
Definition:
ByteEvents.cpp:16
proxygen
lib
http
session
ByteEvents.cpp
Generated by
1.8.11