Skip to content

Commit

Permalink
Add basic telemetry to WindowWalker (#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
enricogior authored Apr 3, 2020
1 parent 2806c38 commit c3a98b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/modules/windowwalker/dll/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class WindowWalker : public PowertoyModuleIface
m_hProcess = sei.hProcess;

m_enabled = true;
Trace::EnableWindowWalker(true);
}

// Disable the powertoy
Expand All @@ -154,6 +155,7 @@ class WindowWalker : public PowertoyModuleIface
}

m_enabled = false;
Trace::EnableWindowWalker(false);
}

// Returns if the powertoys is enabled
Expand Down
5 changes: 3 additions & 2 deletions src/modules/windowwalker/dll/trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ void Trace::UnregisterProvider()
TraceLoggingUnregister(g_hProvider);
}

void Trace::MyEvent()
void Trace::EnableWindowWalker(const bool enabled) noexcept
{
TraceLoggingWrite(
g_hProvider,
"PowerToyName_MyEvent",
"WindowWalker_EnableWindowWalker",
TraceLoggingBoolean(enabled, "Enabled"),
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
Expand Down
2 changes: 1 addition & 1 deletion src/modules/windowwalker/dll/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ class Trace
public:
static void RegisterProvider();
static void UnregisterProvider();
static void MyEvent();
static void EnableWindowWalker(const bool enabled) noexcept;
};

0 comments on commit c3a98b2

Please sign in to comment.