diff options
Diffstat (limited to 'src/libdash/source/metrics')
-rw-r--r-- | src/libdash/source/metrics/HTTPTransaction.cpp | 122 | ||||
-rw-r--r-- | src/libdash/source/metrics/HTTPTransaction.h | 68 | ||||
-rw-r--r-- | src/libdash/source/metrics/TCPConnection.cpp | 62 | ||||
-rw-r--r-- | src/libdash/source/metrics/TCPConnection.h | 49 | ||||
-rw-r--r-- | src/libdash/source/metrics/ThroughputMeasurement.cpp | 46 | ||||
-rw-r--r-- | src/libdash/source/metrics/ThroughputMeasurement.h | 43 |
6 files changed, 390 insertions, 0 deletions
diff --git a/src/libdash/source/metrics/HTTPTransaction.cpp b/src/libdash/source/metrics/HTTPTransaction.cpp new file mode 100644 index 00000000..2767b514 --- /dev/null +++ b/src/libdash/source/metrics/HTTPTransaction.cpp @@ -0,0 +1,122 @@ +/* + * HTTPTransaction.cpp + ***************************************************************************** + * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved + * + * Email: libdash-dev@vicky.bitmovin.net + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "HTTPTransaction.h" + +using namespace dash::metrics; + +HTTPTransaction::HTTPTransaction () : + tcpId (0), + type (dash::metrics::Other), + responseCode (0), + interval (0), + url (""), + actualUrl (""), + range (""), + tRequest (""), + tResponse (""), + httpHeader ("") +{ +} +HTTPTransaction::~HTTPTransaction() +{ + for (size_t i = 0; i < trace.size(); i++) + delete trace.at(i); +} + +uint32_t HTTPTransaction::TCPId () const +{ + return this->tcpId; +} +void HTTPTransaction::SetTCPId (uint32_t tcpId) +{ + this->tcpId = tcpId; +} +HTTPTransactionType HTTPTransaction::Type () const +{ + return this->type; +} +void HTTPTransaction::SetType (HTTPTransactionType type) +{ + this->type = type; +} +const std::string& HTTPTransaction::OriginalUrl () const +{ + return this->url; +} +void HTTPTransaction::SetOriginalUrl (const std::string& origUrl) +{ + this->url = origUrl; +} +const std::string& HTTPTransaction::ActualUrl () const +{ + return this->actualUrl; +} +void HTTPTransaction::SetActualUrl (const std::string& actUrl) +{ + this->actualUrl = actUrl; +} +const std::string& HTTPTransaction::Range () const +{ + return this->range; +} +void HTTPTransaction::SetRange (const std::string& range) +{ + this->range = range; +} +const std::string& HTTPTransaction::RequestSentTime () const +{ + return this->tRequest; +} +void HTTPTransaction::SetRequestSentTime (std::string tRequest) +{ + this->tRequest = tRequest; +} +const std::string& HTTPTransaction::ResponseReceivedTime () const +{ + return this->tResponse; +} +void HTTPTransaction::SetResponseReceivedTime (std::string tResponse) +{ + this->tResponse = tResponse; +} +uint16_t HTTPTransaction::ResponseCode () const +{ + return this->responseCode; +} +void HTTPTransaction::SetResponseCode (uint16_t respCode) +{ + this->responseCode = respCode; +} +uint64_t HTTPTransaction::Interval () const +{ + return this->interval; +} +void HTTPTransaction::SetInterval (uint64_t interval) +{ + this->interval = interval; +} +const std::vector<IThroughputMeasurement *>& HTTPTransaction::ThroughputTrace () const +{ + return (std::vector<IThroughputMeasurement *> &) this->trace; +} +void HTTPTransaction::AddThroughputMeasurement (ThroughputMeasurement *throuputEntry) +{ + this->trace.push_back(throuputEntry); +} +const std::string& HTTPTransaction::HTTPHeader () const +{ + return this->httpHeader; +} +void HTTPTransaction::AddHTTPHeaderLine (std::string headerLine) +{ + this->httpHeader.append(headerLine); +} diff --git a/src/libdash/source/metrics/HTTPTransaction.h b/src/libdash/source/metrics/HTTPTransaction.h new file mode 100644 index 00000000..77c69234 --- /dev/null +++ b/src/libdash/source/metrics/HTTPTransaction.h @@ -0,0 +1,68 @@ +/* + * HTTPTransaction.h + ***************************************************************************** + * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved + * + * Email: libdash-dev@vicky.bitmovin.net + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef HTTPTRANSACTION_H_ +#define HTTPTRANSACTION_H_ + +#include "IHTTPTransaction.h" +#include "ThroughputMeasurement.h" + +namespace dash +{ + namespace metrics + { + class HTTPTransaction : public IHTTPTransaction + { + public: + HTTPTransaction (); + virtual ~HTTPTransaction (); + + uint32_t TCPId () const; + HTTPTransactionType Type () const; + const std::string& OriginalUrl () const; + const std::string& ActualUrl () const; + const std::string& Range () const; + const std::string& RequestSentTime () const; + const std::string& ResponseReceivedTime () const; + uint16_t ResponseCode () const; + uint64_t Interval () const; + const std::vector<IThroughputMeasurement *>& ThroughputTrace () const; + const std::string& HTTPHeader () const; + + void SetTCPId (uint32_t tcpId); + void SetType (HTTPTransactionType type); + void SetOriginalUrl (const std::string& origUrl); + void SetActualUrl (const std::string& actUrl); + void SetRange (const std::string& range); + void SetRequestSentTime (std::string tRequest); + void SetResponseReceivedTime (std::string tResponse); + void SetResponseCode (uint16_t respCode); + void SetInterval (uint64_t interval); + void AddThroughputMeasurement (ThroughputMeasurement *throuputEntry); + void AddHTTPHeaderLine (std::string headerLine); + + private: + uint32_t tcpId; + HTTPTransactionType type; + std::string url; + std::string actualUrl; + std::string range; + std::string tRequest; + std::string tResponse; + uint16_t responseCode; + uint64_t interval; + std::vector<ThroughputMeasurement *> trace; + std::string httpHeader; + }; + } +} + +#endif /* HTTPTRANSACTION_H_ */ diff --git a/src/libdash/source/metrics/TCPConnection.cpp b/src/libdash/source/metrics/TCPConnection.cpp new file mode 100644 index 00000000..581b0539 --- /dev/null +++ b/src/libdash/source/metrics/TCPConnection.cpp @@ -0,0 +1,62 @@ +/* + * TCPConnection.cpp + ***************************************************************************** + * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved + * + * Email: libdash-dev@vicky.bitmovin.net + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "TCPConnection.h" + +using namespace dash::metrics; + +TCPConnection::TCPConnection () +{ +} +TCPConnection::~TCPConnection() +{ +} + +uint32_t TCPConnection::TCPId () const +{ + return this->tcpId; +} +void TCPConnection::SetTCPId (uint32_t tcpId) +{ + this->tcpId = tcpId; +} +const std::string& TCPConnection::DestinationAddress () const +{ + return this->dest; +} +void TCPConnection::SetDestinationAddress (const std::string& destAddress) +{ + this->dest = destAddress; +} +const std::string& TCPConnection::ConnectionOpenedTime () const +{ + return this->tOpen; +} +void TCPConnection::SetConnectionOpenedTime (std::string tOpen) +{ + this->tOpen = tOpen; +} +const std::string& TCPConnection::ConnectionClosedTime () const +{ + return this->tClose; +} +void TCPConnection::SetConnectionClosedTime (std::string tClose) +{ + this->tClose = tClose; +} +uint64_t TCPConnection::ConnectionTime () const +{ + return this->tConnect; +} +void TCPConnection::SetConnectionTime (uint64_t tConnect) +{ + this->tConnect = tConnect; +} diff --git a/src/libdash/source/metrics/TCPConnection.h b/src/libdash/source/metrics/TCPConnection.h new file mode 100644 index 00000000..d4618d7f --- /dev/null +++ b/src/libdash/source/metrics/TCPConnection.h @@ -0,0 +1,49 @@ +/* + * TCPConnection.h + ***************************************************************************** + * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved + * + * Email: libdash-dev@vicky.bitmovin.net + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef TCPCONNECTION_H_ +#define TCPCONNECTION_H_ + +#include "ITCPConnection.h" + +namespace dash +{ + namespace metrics + { + class TCPConnection : public ITCPConnection + { + public: + TCPConnection (); + virtual ~TCPConnection (); + + uint32_t TCPId () const; + const std::string& DestinationAddress () const; + const std::string& ConnectionOpenedTime () const; + const std::string& ConnectionClosedTime () const; + uint64_t ConnectionTime () const; + + void SetTCPId (uint32_t tcpId); + void SetDestinationAddress (const std::string& destAddress); + void SetConnectionOpenedTime (std::string tOpen); + void SetConnectionClosedTime (std::string tClose); + void SetConnectionTime (uint64_t tConnect); + + private: + uint32_t tcpId; + std::string dest; + std::string tOpen; + std::string tClose; + uint64_t tConnect; + }; + } +} + +#endif /* TCPCONNECTION_H_ */ diff --git a/src/libdash/source/metrics/ThroughputMeasurement.cpp b/src/libdash/source/metrics/ThroughputMeasurement.cpp new file mode 100644 index 00000000..8d2c485e --- /dev/null +++ b/src/libdash/source/metrics/ThroughputMeasurement.cpp @@ -0,0 +1,46 @@ +/* + * ThroughputMeasurement.cpp + ***************************************************************************** + * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved + * + * Email: libdash-dev@vicky.bitmovin.net + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "ThroughputMeasurement.h" + +using namespace dash::metrics; + +ThroughputMeasurement::ThroughputMeasurement () +{ +} +ThroughputMeasurement::~ThroughputMeasurement() +{ +} + +const std::string& ThroughputMeasurement::StartOfPeriod () const +{ + return this->startOfPeriod; +} +void ThroughputMeasurement::SetStartOfPeriod (std::string start) +{ + this->startOfPeriod = start; +} +uint64_t ThroughputMeasurement::DurationOfPeriod () const +{ + return this->durationOfPeriod; +} +void ThroughputMeasurement::SetDurationOfPeriod (uint64_t duration) +{ + this->durationOfPeriod = duration; +} +const std::vector<uint32_t>& ThroughputMeasurement::ReceivedBytesPerTrace () const +{ + return this->receivedBytesPerTrace; +} +void ThroughputMeasurement::AddReceivedBytes (uint32_t numberOfBytes) +{ + this->receivedBytesPerTrace.push_back(numberOfBytes); +} diff --git a/src/libdash/source/metrics/ThroughputMeasurement.h b/src/libdash/source/metrics/ThroughputMeasurement.h new file mode 100644 index 00000000..817e30d9 --- /dev/null +++ b/src/libdash/source/metrics/ThroughputMeasurement.h @@ -0,0 +1,43 @@ +/* + * ThroughputMeasurement.h + ***************************************************************************** + * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved + * + * Email: libdash-dev@vicky.bitmovin.net + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef THROUGHPUTMEASUREMENT_H_ +#define THROUGHPUTMEASUREMENT_H_ + +#include "IThroughputMeasurement.h" + +namespace dash +{ + namespace metrics + { + class ThroughputMeasurement : public IThroughputMeasurement + { + public: + ThroughputMeasurement (); + virtual ~ThroughputMeasurement (); + + const std::string& StartOfPeriod () const; + uint64_t DurationOfPeriod () const; + const std::vector<uint32_t>& ReceivedBytesPerTrace () const; + + void SetStartOfPeriod (std::string startOfPeriod); + void SetDurationOfPeriod (uint64_t duration); + void AddReceivedBytes (uint32_t numberOfBytes); + + private: + std::string startOfPeriod; + uint64_t durationOfPeriod; + std::vector<uint32_t> receivedBytesPerTrace; + }; + } +} + +#endif /* THROUGHPUTMEASUREMENT_H_ */ |