aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/trace/tracerecorder.h
blob: 48857aec8e116a7e3fac30f94340dbe85008b5e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include <zencore/guid.h>
#include <zencore/zencore.h>

#include <filesystem>
#include <memory>
#include <string>
#include <vector>

namespace zen {

struct TraceSessionInfo
{
	Guid				  SessionGuid{};
	Guid				  TraceGuid{};
	uint16_t			  ControlPort	   = 0;
	uint8_t				  TransportVersion = 0;
	uint8_t				  ProtocolVersion  = 0;
	std::string			  RemoteAddress;
	uint64_t			  BytesRecorded = 0;
	std::filesystem::path TraceFilePath;
};

class TraceRecorder
{
public:
	TraceRecorder();
	~TraceRecorder();

	void Initialize(uint16_t InPort, const std::filesystem::path& OutputDir);
	void Shutdown();

	bool	 IsRunning() const;
	uint16_t GetPort() const;

	std::vector<TraceSessionInfo> GetActiveSessions() const;

private:
	struct Impl;
	std::unique_ptr<Impl> m_Impl;
};

}  // namespace zen