| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft. All rights reserved. |
| 4 | |
| 5 | Module Name: |
| 6 | |
| 7 | GuestTelemetryLogger.h |
| 8 | |
| 9 | Abstract: |
| 10 | |
| 11 | This file contains declarations used to log guest telemetry. |
| 12 | |
| 13 | --*/ |
| 14 | |
| 15 | #pragma once |
| 16 | |
| 17 | #include "RingBuffer.h" |
| 18 | #include "relay.hpp" |
| 19 | |
| 20 | class GuestTelemetryLogger |
| 21 | { |
| 22 | public: |
| 23 | GuestTelemetryLogger() = delete; |
| 24 | ~GuestTelemetryLogger(); |
| 25 | |
| 26 | static std::shared_ptr<GuestTelemetryLogger> Create(GUID VmId, const wil::unique_event& ExitEvent); |
| 27 | |
| 28 | LPCWSTR GetPipeName() const; |
| 29 | |
| 30 | private: |
| 31 | GuestTelemetryLogger(GUID VmId); |
| 32 | |
| 33 | void Start(const wil::unique_event& ExitEvent); |
| 34 | void ProcessInput(const std::string_view Input); |
| 35 | |
| 36 | std::wstring m_pipeName; |
| 37 | wil::unique_event m_threadExit; |
| 38 | std::thread m_thread; |
| 39 | GUID m_runtimeId{}; |
| 40 | RingBuffer m_ringBuffer{LX_RELAY_BUFFER_SIZE}; |
| 41 | }; |