<commit_before>#pragma once

#include <chrono>
#include <cstdint>
#include <thread>

#include "blackhole/attributes.hpp"
#include "blackhole/cpp17/string_view.hpp"

namespace blackhole {

using cpp17::string_view;

class record_t {
public:
    typedef std::chrono::high_resolution_clock clock_type;
    typedef clock_type::time_point time_point;

private:
    struct inner_t;

    typedef std::aligned_storage<64>::type storage_type;
    storage_type storage;

public:
    /// Creates a log record with the given severity, possibly unformatted message and attributes.
    ///
    /// The created record contains almost all information about the logging event associated except
    /// the timestamp and formatted message.
    ///
    /// These missing attributes are set right after filtering pass with `activate` method.
    record_t(int severity, const string_view& message, const attribute_pack& attributes);

    auto message() const noexcept -> const string_view&;
    auto severity() const noexcept -> int;
    auto timestamp() const noexcept -> time_point;

    auto pid() const noexcept -> std::uint64_t;
    auto tid() const noexcept -> std::thread::id;

    auto formatted() const noexcept -> const string_view&;
    auto attributes() const noexcept -> const attribute_pack&;

    /// Activate the record by setting the given formatted message accompanied by obtaining and
    /// setting the current time point.
    auto activate(const string_view& formatted = string_view()) noexcept -> void;

private:
    // Constructing from rvalue references is explicitly forbidden.
    // TODO: Consider more elegant solution.
    record_t(int severity, const string_view&, attribute_pack&&) = delete;
    record_t(int severity, string_view&&, const attribute_pack&) = delete;
    record_t(int severity, string_view&&, attribute_pack&&) = delete;

    auto inner() noexcept -> inner_t&;
    auto inner() const noexcept -> const inner_t&;
};

}  // namespace blackhole
<commit_msg>fix(record): change clock type for system<commit_after>#pragma once

#include <chrono>
#include <cstdint>
#include <thread>

#include "blackhole/attributes.hpp"
#include "blackhole/cpp17/string_view.hpp"

namespace blackhole {

using cpp17::string_view;

class record_t {
public:
    typedef std::chrono::system_clock clock_type;
    typedef clock_type::time_point time_point;

private:
    struct inner_t;

    typedef std::aligned_storage<64>::type storage_type;
    storage_type storage;

public:
    /// Creates a log record with the given severity, possibly unformatted message and attributes.
    ///
    /// The created record contains almost all information about the logging event associated except
    /// the timestamp and formatted message.
    ///
    /// These missing attributes are set right after filtering pass with `activate` method.
    record_t(int severity, const string_view& message, const attribute_pack& attributes);

    auto message() const noexcept -> const string_view&;
    auto severity() const noexcept -> int;
    auto timestamp() const noexcept -> time_point;

    auto pid() const noexcept -> std::uint64_t;
    auto tid() const noexcept -> std::thread::id;

    auto formatted() const noexcept -> const string_view&;
    auto attributes() const noexcept -> const attribute_pack&;

    /// Activate the record by setting the given formatted message accompanied by obtaining and
    /// setting the current time point.
    auto activate(const string_view& formatted = string_view()) noexcept -> void;

private:
    // Constructing from rvalue references is explicitly forbidden.
    // TODO: Consider more elegant solution.
    record_t(int severity, const string_view&, attribute_pack&&) = delete;
    record_t(int severity, string_view&&, const attribute_pack&) = delete;
    record_t(int severity, string_view&&, attribute_pack&&) = delete;

    auto inner() noexcept -> inner_t&;
    auto inner() const noexcept -> const inner_t&;
};

}  // namespace blackhole

{'fraction_non_alphanumeric': 0.09771414217533284, 'fraction_numerical': 0.004019090680733484, 'mean_word_length': 3.916049382716049, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5296932', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1066, 'n_words': 385}