mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Fix telemetry event names
add setting changed event for ShortcutGuide
This commit is contained in:
committed by
Enrico Giordani
parent
b892e731d9
commit
dc34379344
@@ -351,7 +351,7 @@ void D2DOverlayWindow::on_hide() {
|
||||
std::chrono::steady_clock::time_point shown_end_time = std::chrono::steady_clock::now();
|
||||
// Trace the event only if the overaly window was visible.
|
||||
if (shown_start_time.time_since_epoch().count() > 0) {
|
||||
Trace::EventHide(std::chrono::duration_cast<std::chrono::milliseconds>(shown_end_time - shown_start_time).count(), key_pressed);
|
||||
Trace::HideGuide(std::chrono::duration_cast<std::chrono::milliseconds>(shown_end_time - shown_start_time).count(), key_pressed);
|
||||
shown_start_time = {};
|
||||
}
|
||||
key_pressed.clear();
|
||||
|
||||
@@ -80,6 +80,7 @@ void OverlayWindow::set_config(const wchar_t * config) {
|
||||
winkey_popup->set_theme(theme.value);
|
||||
}
|
||||
_values.save_to_settings_file();
|
||||
Trace::SettingsChanged(pressTime.value, overlayOpacity.value, theme.value);
|
||||
}
|
||||
catch (std::exception&) {
|
||||
// Improper JSON.
|
||||
|
||||
@@ -16,7 +16,7 @@ void Trace::UnregisterProvider() noexcept {
|
||||
TraceLoggingUnregister(g_hProvider);
|
||||
}
|
||||
|
||||
void Trace::EventHide(const __int64 duration_ms, std::vector<int> &key_pressed) noexcept {
|
||||
void Trace::HideGuide(const __int64 duration_ms, std::vector<int> &key_pressed) noexcept {
|
||||
std::string vk_codes;
|
||||
std::vector<int>::iterator it;
|
||||
for (it = key_pressed.begin(); it != key_pressed.end(); ) {
|
||||
@@ -28,7 +28,7 @@ void Trace::EventHide(const __int64 duration_ms, std::vector<int> &key_pressed)
|
||||
|
||||
TraceLoggingWrite(
|
||||
g_hProvider,
|
||||
"ShortcutGuide::Event::HideGuide",
|
||||
"ShortcutGuide_HideGuide",
|
||||
TraceLoggingInt64(duration_ms, "DurationInMs"),
|
||||
TraceLoggingInt64(key_pressed.size(), "NumberOfKeysPressed"),
|
||||
TraceLoggingString(vk_codes.c_str(), "ListOfKeysPressed"),
|
||||
@@ -37,12 +37,24 @@ void Trace::EventHide(const __int64 duration_ms, std::vector<int> &key_pressed)
|
||||
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
|
||||
}
|
||||
|
||||
void Trace::EnableShortcutGuide(bool enabled) noexcept {
|
||||
void Trace::EnableShortcutGuide(const bool enabled) noexcept {
|
||||
TraceLoggingWrite(
|
||||
g_hProvider,
|
||||
"ShortcutGuide::Event::EnableGuide",
|
||||
"ShortcutGuide_EnableGuide",
|
||||
TraceLoggingBoolean(enabled, "Enabled"),
|
||||
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
|
||||
TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
|
||||
}
|
||||
|
||||
void Trace::SettingsChanged(const int press_delay_time, const int overlay_opacity, const std::wstring& theme) noexcept {
|
||||
TraceLoggingWrite(
|
||||
g_hProvider,
|
||||
"ShortcutGuide_SettingsChanged",
|
||||
TraceLoggingInt32(press_delay_time, "PressDelayTime"),
|
||||
TraceLoggingInt32(overlay_opacity, "OverlayOpacity"),
|
||||
TraceLoggingWideString(theme.c_str(), "Theme"),
|
||||
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
|
||||
TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"),
|
||||
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ class Trace {
|
||||
public:
|
||||
static void RegisterProvider() noexcept;
|
||||
static void UnregisterProvider() noexcept;
|
||||
static void EventHide(const __int64 duration_ms, std::vector<int> &key_pressed) noexcept;
|
||||
static void EnableShortcutGuide(bool enabled) noexcept;
|
||||
static void HideGuide(const __int64 duration_ms, std::vector<int> &key_pressed) noexcept;
|
||||
static void EnableShortcutGuide(const bool enabled) noexcept;
|
||||
static void SettingsChanged(const int press_delay_time, const int overlay_opacity, const std::wstring& theme) noexcept;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user