Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::HTTPLogType Class Reference
Inheritance diagram for duckdb::HTTPLogType:
Collaboration diagram for duckdb::HTTPLogType:

Public Member Functions

 HTTPLogType ()
 Construct the log types.
Public Member Functions inherited from duckdb::LogType
 LogType (const string &name_p, const LogLevel &level_p)
 Construct an unstructured type.
 LogType (const string &name_p, const LogLevel &level_p, LogicalType structured_type)
 Construct a structured type.

Static Public Member Functions

static LogicalType GetLogType ()
static string ConstructLogMessage (BaseRequest &request, optional_ptr< HTTPResponse > response)
static string ConstructLogMessage (const string &str)

Static Public Attributes

static constexpr const char * NAME = "HTTP"
static constexpr LogLevel LEVEL = LogLevel::LOG_DEBUG

Additional Inherited Members

Public Attributes inherited from duckdb::LogType
string name
LogLevel level
bool is_structured
LogicalType type

Constructor & Destructor Documentation

◆ HTTPLogType()

duckdb::HTTPLogType::HTTPLogType ( )

Construct the log types.

260729 : LogType(NAME, LEVEL, GetLogType()) {
260730}
LogType(const string &name_p, const LogLevel &level_p)
Construct an unstructured type.
Definition duckdb.hpp:39081
Here is the call graph for this function:

Member Function Documentation

◆ GetLogType()

LogicalType duckdb::HTTPLogType::GetLogType ( )
static
260732 {
260733 child_list_t<LogicalType> request_child_list = {
260734 {"type", LogicalType::VARCHAR},
260735 {"url", LogicalType::VARCHAR},
260736 {"start_time", LogicalType::TIMESTAMP_TZ},
260737 {"duration_ms", LogicalType::BIGINT},
260738 {"headers", LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)},
260739 };
260740 auto request_type = LogicalType::STRUCT(request_child_list);
260741
260742 child_list_t<LogicalType> response_child_list = {
260743 {"status", LogicalType::VARCHAR},
260744 {"reason", LogicalType::VARCHAR},
260745 {"headers", LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR)},
260746 };
260747 auto response_type = LogicalType::STRUCT(response_child_list);
260748 ;
260749
260750 LogicalType result_type;
260751 child_list_t<LogicalType> child_list = {{"request", request_type}, {"response", response_type}};
260752 return LogicalType::STRUCT(child_list);
260753}

◆ ConstructLogMessage() [1/2]

string duckdb::HTTPLogType::ConstructLogMessage ( BaseRequest & request,
optional_ptr< HTTPResponse > response )
static
260765 {
260766 child_list_t<Value> request_child_list = {
260767 {"type", Value(EnumUtil::ToString(request.type))},
260768 {"url", Value(request.url)},
260769 {"headers", CreateHTTPHeadersValue(request.headers)},
260770 {"start_time", request.have_request_timing ? Value::TIMESTAMP(request.request_start) : Value()},
260771 {"duration_ms", request.have_request_timing ? Value::BIGINT(Timestamp::GetEpochMs(request.request_end) -
260772 Timestamp::GetEpochMs(request.request_start))
260773 : Value()}};
260774 auto request_value = Value::STRUCT(request_child_list);
260775 Value response_value;
260776 if (response) {
260777 child_list_t<Value> response_child_list = {
260778 {"status", Value(EnumUtil::ToString(response->status))},
260779 {"reason", Value(response->reason)},
260780 {"headers", CreateHTTPHeadersValue(response->headers)},
260781 };
260782 response_value = Value::STRUCT(response_child_list);
260783 }
260784
260785 child_list_t<Value> child_list = {{"request", request_value}, {"response", response_value}};
260786
260787 return Value::STRUCT(child_list).ToString();
260788}
static DUCKDB_API int64_t GetEpochMs(timestamp_t timestamp)
Convert the epoch (in ms) to a timestamp.
Definition duckdb.cpp:129904
static DUCKDB_API Value BIGINT(int64_t value)
Create a bigint Value from a specified value.
Definition duckdb.cpp:132146
static DUCKDB_API Value STRUCT(child_list_t< Value > values)
Create a struct value with given list of entries.
Definition duckdb.cpp:132434
Definition duckdb.hpp:5647
DUCKDB_API string ToString() const
Convert this value to a string.
Definition duckdb.cpp:133318
static DUCKDB_API Value TIMESTAMP(date_t date, dtime_t time)
Create a timestamp Value from a specified date/time combination.
Definition duckdb.cpp:132409

◆ ConstructLogMessage() [2/2]

string duckdb::HTTPLogType::ConstructLogMessage ( const string & str)
inlinestatic
39145 {
39146 return str;
39147 }

The documentation for this class was generated from the following files: