mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
TextLog - add event_time_microseconds field
This commit is contained in:
parent
5df5fb4cd0
commit
142c482210
@ -23,6 +23,7 @@ ExtendedLogMessage ExtendedLogMessage::getFrom(const Poco::Message & base)
|
|||||||
|
|
||||||
msg_ext.time_seconds = static_cast<UInt32>(tv.tv_sec);
|
msg_ext.time_seconds = static_cast<UInt32>(tv.tv_sec);
|
||||||
msg_ext.time_microseconds = static_cast<UInt32>(tv.tv_usec);
|
msg_ext.time_microseconds = static_cast<UInt32>(tv.tv_usec);
|
||||||
|
msg_ext.time_in_microseconds = static_cast<UInt64>((tv.tv_sec) * 1000000U + (tv.tv_usec));
|
||||||
|
|
||||||
if (current_thread)
|
if (current_thread)
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,7 @@ public:
|
|||||||
|
|
||||||
uint32_t time_seconds = 0;
|
uint32_t time_seconds = 0;
|
||||||
uint32_t time_microseconds = 0;
|
uint32_t time_microseconds = 0;
|
||||||
|
uint64_t time_in_microseconds = 0;
|
||||||
|
|
||||||
uint64_t thread_id = 0;
|
uint64_t thread_id = 0;
|
||||||
std::string query_id;
|
std::string query_id;
|
||||||
|
@ -76,6 +76,7 @@ void OwnSplitChannel::logSplit(const Poco::Message & msg)
|
|||||||
TextLogElement elem;
|
TextLogElement elem;
|
||||||
|
|
||||||
elem.event_time = msg_ext.time_seconds;
|
elem.event_time = msg_ext.time_seconds;
|
||||||
|
elem.event_time_microseconds = msg_ext.time_in_microseconds;
|
||||||
elem.microseconds = msg_ext.time_microseconds;
|
elem.microseconds = msg_ext.time_microseconds;
|
||||||
|
|
||||||
elem.thread_name = getThreadName();
|
elem.thread_name = getThreadName();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <DataTypes/DataTypeEnum.h>
|
#include <DataTypes/DataTypeEnum.h>
|
||||||
#include <DataTypes/DataTypesNumber.h>
|
#include <DataTypes/DataTypesNumber.h>
|
||||||
#include <DataTypes/DataTypeDateTime.h>
|
#include <DataTypes/DataTypeDateTime.h>
|
||||||
|
#include <DataTypes/DataTypeDateTime64.h>
|
||||||
#include <DataTypes/DataTypeDate.h>
|
#include <DataTypes/DataTypeDate.h>
|
||||||
#include <DataTypes/DataTypeString.h>
|
#include <DataTypes/DataTypeString.h>
|
||||||
#include <Common/ClickHouseRevision.h>
|
#include <Common/ClickHouseRevision.h>
|
||||||
@ -29,6 +30,7 @@ Block TextLogElement::createBlock()
|
|||||||
{
|
{
|
||||||
{std::make_shared<DataTypeDate>(), "event_date"},
|
{std::make_shared<DataTypeDate>(), "event_date"},
|
||||||
{std::make_shared<DataTypeDateTime>(), "event_time"},
|
{std::make_shared<DataTypeDateTime>(), "event_time"},
|
||||||
|
{std::make_shared<DataTypeDateTime64>(6), "event_time_microseconds"},
|
||||||
{std::make_shared<DataTypeUInt32>(), "microseconds"},
|
{std::make_shared<DataTypeUInt32>(), "microseconds"},
|
||||||
|
|
||||||
{std::make_shared<DataTypeLowCardinality>(std::make_shared<DataTypeString>()), "thread_name"},
|
{std::make_shared<DataTypeLowCardinality>(std::make_shared<DataTypeString>()), "thread_name"},
|
||||||
@ -52,6 +54,7 @@ void TextLogElement::appendToBlock(MutableColumns & columns) const
|
|||||||
|
|
||||||
columns[i++]->insert(DateLUT::instance().toDayNum(event_time));
|
columns[i++]->insert(DateLUT::instance().toDayNum(event_time));
|
||||||
columns[i++]->insert(event_time);
|
columns[i++]->insert(event_time);
|
||||||
|
columns[i++]->insert(event_time_microseconds);
|
||||||
columns[i++]->insert(microseconds);
|
columns[i++]->insert(microseconds);
|
||||||
|
|
||||||
columns[i++]->insertData(thread_name.data(), thread_name.size());
|
columns[i++]->insertData(thread_name.data(), thread_name.size());
|
||||||
|
@ -9,6 +9,7 @@ using Poco::Message;
|
|||||||
struct TextLogElement
|
struct TextLogElement
|
||||||
{
|
{
|
||||||
time_t event_time{};
|
time_t event_time{};
|
||||||
|
UInt64 event_time_microseconds{};
|
||||||
UInt32 microseconds;
|
UInt32 microseconds;
|
||||||
|
|
||||||
String thread_name;
|
String thread_name;
|
||||||
|
Loading…
Reference in New Issue
Block a user