telemetry/datapoint/analytics_event.hpp
2025-09-24 19:52:20 +00:00

34 lines
684 B
C++

#pragma once
#include <chrono>
#include <optional>
#include <string>
namespace djm::device {
struct AnalyticsEvent {
enum class Type {
AcousticImagingReady,
SdCardFormatted,
ExceptionThrown,
ImageSaved,
VideoSaved,
ImagingFrequencyChanged,
};
Type type;
/** sender-side timestamp */
std::chrono::system_clock::time_point timestamp;
/** set if type == ExceptionThrown */
std::optional<std::string> exceptionWhat;
/** set if type == ImagingFrequencyChanged */
std::optional<float> newFrequency;
/** Meant for debugging only: Format this event as a human readable text */
std::string fmtDebug() const;
};
} // namespace djm::device