-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added timestamps to tcp server and client workers for latency calcula…
…tions
- Loading branch information
Janitha Karunaratne
committed
Mar 5, 2014
1 parent
0a52401
commit 3510557
Showing
7 changed files
with
127 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "common.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
#include <ev.h> | ||
|
||
#include "params.h" | ||
#include "events.h" | ||
|
||
#define DEBUG 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "events.h" | ||
|
||
#define NS_PER_S 1000000000 | ||
|
||
uint64_t timestamp_ns_now() { | ||
uint64_t nsec; | ||
timespec tspec; | ||
clock_gettime(CLOCK_REALTIME, &tspec); | ||
nsec = tspec.tv_sec * NS_PER_S + tspec.tv_nsec; | ||
return nsec; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef EVENTS_H | ||
#define EVENTS_H | ||
|
||
#include <ctime> | ||
#include <cstdint> | ||
|
||
uint64_t timestamp_ns_now(); | ||
|
||
class Event { | ||
public: | ||
Event() {} | ||
virtual ~Event() {} | ||
}; | ||
|
||
class TcpClientEvent : public Event { | ||
public: | ||
uint64_t established_time; | ||
|
||
TcpClientEvent() : Event() {} | ||
virtual ~TcpClientEvent() {} | ||
}; | ||
|
||
|
||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters