#ifndef TILE_BASE_WRITE_MOSTLY_METRICS_H
#define TILE_BASE_WRITE_MOSTLY_METRICS_H

#pragma once

#include "tile/base/internal/meta.h"
#include <cstddef>
#include <cstdint>
#include <limits>
#include <utility>

namespace tile {

namespace write_mostly {
namespace detail {
template<typename T>
struct MetricsStats;
}
}// namespace write_mostly

template<typename T>
struct MetricsStats {
    using SumType =
        internal::conditional_t<std::is_integral<T>::value,
                                internal::conditional_t<std::is_signed<T>::value, std::int64_t, std::uint64_t>,
                                long double>;

    SumType sum;
    std::size_t cnt;
    T max;
    T min;
    T average;
};

}// namespace tile

#endif// TILE_BASE_WRITE_MOSTLY_METRICS_H
