diff options
Diffstat (limited to '')
| -rw-r--r-- | src/web_service/telemetry_json.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/web_service/telemetry_json.cpp b/src/web_service/telemetry_json.cpp index 0a8f2bd9e..9156ce802 100644 --- a/src/web_service/telemetry_json.cpp +++ b/src/web_service/telemetry_json.cpp | |||
| @@ -102,16 +102,27 @@ void TelemetryJson::Complete() { | |||
| 102 | impl->SerializeSection(Telemetry::FieldType::App, "App"); | 102 | impl->SerializeSection(Telemetry::FieldType::App, "App"); |
| 103 | impl->SerializeSection(Telemetry::FieldType::Session, "Session"); | 103 | impl->SerializeSection(Telemetry::FieldType::Session, "Session"); |
| 104 | impl->SerializeSection(Telemetry::FieldType::Performance, "Performance"); | 104 | impl->SerializeSection(Telemetry::FieldType::Performance, "Performance"); |
| 105 | impl->SerializeSection(Telemetry::FieldType::UserFeedback, "UserFeedback"); | ||
| 106 | impl->SerializeSection(Telemetry::FieldType::UserConfig, "UserConfig"); | 105 | impl->SerializeSection(Telemetry::FieldType::UserConfig, "UserConfig"); |
| 107 | impl->SerializeSection(Telemetry::FieldType::UserSystem, "UserSystem"); | 106 | impl->SerializeSection(Telemetry::FieldType::UserSystem, "UserSystem"); |
| 108 | 107 | ||
| 109 | auto content = impl->TopSection().dump(); | 108 | auto content = impl->TopSection().dump(); |
| 110 | // Send the telemetry async but don't handle the errors since they were written to the log | 109 | // Send the telemetry async but don't handle the errors since they were written to the log |
| 111 | Common::DetachedTasks::AddTask( | 110 | Common::DetachedTasks::AddTask([host{impl->host}, content]() { |
| 112 | [host{impl->host}, username{impl->username}, token{impl->token}, content]() { | 111 | Client{host, "", ""}.PostJson("/telemetry", content, true); |
| 113 | Client{host, username, token}.PostJson("/telemetry", content, true); | 112 | }); |
| 114 | }); | 113 | } |
| 114 | |||
| 115 | bool TelemetryJson::SubmitTestcase() { | ||
| 116 | impl->SerializeSection(Telemetry::FieldType::App, "App"); | ||
| 117 | impl->SerializeSection(Telemetry::FieldType::Session, "Session"); | ||
| 118 | impl->SerializeSection(Telemetry::FieldType::UserFeedback, "UserFeedback"); | ||
| 119 | impl->SerializeSection(Telemetry::FieldType::UserSystem, "UserSystem"); | ||
| 120 | |||
| 121 | auto content = impl->TopSection().dump(); | ||
| 122 | Client client(impl->host, impl->username, impl->token); | ||
| 123 | auto value = client.PostJson("/gamedb/testcase", content, false); | ||
| 124 | |||
| 125 | return value.result_code == Common::WebResult::Code::Success; | ||
| 115 | } | 126 | } |
| 116 | 127 | ||
| 117 | } // namespace WebService | 128 | } // namespace WebService |