DragonNest/Server/ServiceManagerEx/ServerReporter.h
Cussrro 47f7895977 Revert "修复编码问题"
This reverts commit 9e69c01767.
2024-12-21 10:04:04 +08:00

58 lines
No EOL
1.7 KiB
C++

#pragma once
#include <sstream>
namespace ServerReport
{
struct View
{
wstringstream overview;
wstringstream detailview;
};
class CReportView
{
public:
CReportView(const wstring& d);
~CReportView();
public:
void AddView(View* pView);
public:
const wstring& GetDay() const;
const vector<View*>& GetViews() const;
private:
wstring day;
vector<View*> views;
};
class CServerReporter
{
public:
CServerReporter(void);
~CServerReporter(void);
bool is_dbdelay;
public:
void Report(size_t days, bool detail, OUT wstring& report);
void Report(size_t days, bool detail, OUT vector<CReportView*>& report);
private:
CReportView* BuildReport(const wstring& day, const wstring& filename, bool detail) const;
private:
void ParseExceptionLog(const wstring& filename, bool detail, OUT wstringstream& overview, OUT wstringstream& detailview) const;
void ParseDBDelayLog(const wstring& filename, bool detail, OUT wstringstream& overview, OUT wstringstream& detailview, OUT bool& delay) const;
void ParseGameDelayLog(const wstring& filename, bool detail, OUT wstringstream& overview, OUT wstringstream& detailview) const;
void ParseVillageDelayLog(const wstring& filename, bool detail, OUT wstringstream& overview, OUT wstringstream& detailview) const;
void ParseDBErrorLog(const wstring& filename, bool detail, OUT wstringstream& overview, OUT wstringstream& detailview) const;
void ParseDBSystemErrorLog(const wstring& filename, bool detail, OUT wstringstream& overview, OUT wstringstream& detailview) const;
private:
void GetReportTime(size_t days, OUT map<wstring, wstring>& times) const;
wstring ConvertDayOfWeek(int weekday) const;
};
}