LeviLamina
Loading...
Searching...
No Matches
CodeBuilderPerformance.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
8// clang-format on
9
11public:
12 // CodeBuilderPerformance inner types define
13 enum class Flags : int {
14 AwaitingFirstCommandSent = 0,
15 AwaitingFirstCommandReceived = 1,
16 AwaitingFirstCommandRun = 2,
17 CodeScreenCached = 3,
18 CodeRunStarted = 4,
19 FirstWorldLaunch = 5,
20 FirstSessionLaunch = 6,
21 TutorialCached = 7,
22 Count = 8,
23 };
24
25 enum class Stage : int {
26 CacheCodescreenStart = 0,
27 CacheCodescreenFinish = 1,
28 WebviewLoadStart = 2,
29 WebviewLoadFinish = 3,
30 CreateNewProject = 4,
31 ProjectLoadStart = 5,
32 ProjectLoadFinish = 6,
33 TutorialLoadStart = 7,
34 TutorialLoadFinish = 8,
35 EditorContentLoaded = 9,
36 LoadBlockly = 10,
37 BlocksContentLoaded = 11,
38 NetworkRequest = 12,
39 DomLoaded = 13,
40 CodeRunStart = 14,
41 CodeRunComplete = 15,
42 FirstCommandSent = 16,
43 FirstCommandReceived = 17,
44 FirstCommandRun = 18,
45 };
46
47public:
48 // static functions
49 // NOLINTBEGIN
50#ifdef LL_PLAT_C
51 MCNAPI static void clearFirstSessionLaunch();
52
53 MCNAPI static void clearFirstWorldLaunch();
54#endif
55
56 MCNAPI static void clearTutorialCached();
57
59 ::WebviewObserver const* eventing,
60 ::CodeBuilderPerformance::Stage stage,
61 ::std::string_view codeProjectId,
62 uint64 tutorialSize,
63 uint64 downloadSize,
64 ::std::chrono::milliseconds duration
65 );
66
68 ::WebviewObserver const& eventing,
69 ::CodeBuilderPerformance::Stage stage,
70 ::std::string_view codeProjectId,
71 ::std::chrono::milliseconds duration
72 );
73
74 MCNAPI static uchar getCacheState();
75
76 MCNAPI static ::std::string const getCodeBuilderSessionId();
77
78 MCNAPI static ::std::string const getCodeProjectId();
79
80 MCNAPI static ::std::string const getEditorName();
81
82 MCNAPI static ::std::chrono::milliseconds getElapsedTime(::CodeBuilderPerformance::Stage stage);
83
84 MCNAPI static bool isAwaitingFirstCommandReceived();
85
86 MCNAPI static bool isFirstSessionLaunch();
87
88 MCNAPI static bool isFirstWorldLaunch();
89
90#ifdef LL_PLAT_C
91 MCNAPI static void resetFirstWorldLaunch();
92
93 MCNAPI static void setCodeBuilderSessionId();
94
95 MCNAPI static void setCodeScreenCached();
96
97 MCNAPI static void setEditorName(::std::string const& editorName);
98#endif
99
100 MCNAPI static void setTimeStart(::CodeBuilderPerformance::Stage stage);
101
102 MCNAPI static void setTutorialCached();
103
104 MCNAPI static ::std::string toString(::CodeBuilderPerformance::Stage stage);
105 // NOLINTEND
106
107public:
108 // static variables
109 // NOLINTBEGIN
110 MCNAPI static ::std::optional<::std::chrono::steady_clock::time_point>& mCacheCodeScreenTimeStart();
111
112 MCNAPI static ::std::string& mCodeBuilderProjectId();
113
114 MCNAPI static ::std::string& mCodeBuilderSessionId();
115
116 MCNAPI static ::std::optional<::std::chrono::steady_clock::time_point>& mCodeRunStart();
117
118 MCNAPI static ::std::optional<::std::chrono::steady_clock::time_point>& mCreateNewProjectTimeStart();
119
120 MCNAPI static ::std::string& mEditorName();
121
122 MCNAPI static ::std::bitset<8>& mFlags();
123
124 MCNAPI static ::std::optional<::std::chrono::steady_clock::time_point>& mLastTimestamp();
125
126 MCNAPI static ::std::optional<::std::chrono::steady_clock::time_point>& mProjectLoadTimeStart();
127
128 MCNAPI static ::std::optional<::std::chrono::steady_clock::time_point>& mTutorialLoadTimeStart();
129
130 MCNAPI static ::std::optional<::std::chrono::steady_clock::time_point>& mWebviewLoadTimeStart();
131 // NOLINTEND
132};
Definition CodeBuilderPerformance.h:10
static MCAPI ::std::optional<::std::chrono::steady_clock::time_point > & mWebviewLoadTimeStart()
static MCAPI bool isAwaitingFirstCommandReceived()
static MCAPI ::std::optional<::std::chrono::steady_clock::time_point > & mProjectLoadTimeStart()
static MCAPI uchar getCacheState()
static MCAPI ::std::optional<::std::chrono::steady_clock::time_point > & mCodeRunStart()
static MCAPI void fireCodeBuilderLoadPerformanceEvent(::WebviewObserver const *eventing, ::CodeBuilderPerformance::Stage stage, ::std::string_view codeProjectId, uint64 tutorialSize, uint64 downloadSize, ::std::chrono::milliseconds duration)
static MCAPI ::std::string & mCodeBuilderSessionId()
static MCAPI ::std::string & mCodeBuilderProjectId()
static MCAPI bool isFirstSessionLaunch()
static MCAPI ::std::string const getCodeProjectId()
static MCAPI void fireCodeBuilderRunPerformanceEvent(::WebviewObserver const &eventing, ::CodeBuilderPerformance::Stage stage, ::std::string_view codeProjectId, ::std::chrono::milliseconds duration)
static MCAPI ::std::optional<::std::chrono::steady_clock::time_point > & mTutorialLoadTimeStart()
static MCAPI bool isFirstWorldLaunch()
static MCAPI ::std::optional<::std::chrono::steady_clock::time_point > & mLastTimestamp()
static MCAPI ::std::string const getCodeBuilderSessionId()
static MCAPI ::std::optional<::std::chrono::steady_clock::time_point > & mCreateNewProjectTimeStart()
static MCAPI ::std::string const getEditorName()
static MCAPI void setTimeStart(::CodeBuilderPerformance::Stage stage)
static MCAPI void setTutorialCached()
static MCAPI ::std::chrono::milliseconds getElapsedTime(::CodeBuilderPerformance::Stage stage)
static MCAPI ::std::string toString(::CodeBuilderPerformance::Stage stage)
static MCAPI void clearTutorialCached()
static MCAPI ::std::string & mEditorName()
static MCAPI ::std::optional<::std::chrono::steady_clock::time_point > & mCacheCodeScreenTimeStart()
static MCAPI ::std::bitset< 8 > & mFlags()
Definition WebviewObserver.h:15