mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
NEW: add track events for debugging network
Change-Id: I671f91b4af00277236ca71014f8d667109756d00 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
bd75af4a43
commit
6827b41eb3
13 changed files with 187 additions and 12 deletions
|
@ -233,6 +233,19 @@ void MediaPlayCtrl::Stop(wxString const &msg)
|
|||
} else if (!msg.IsEmpty()) {
|
||||
SetStatus(msg, false);
|
||||
}
|
||||
|
||||
if (m_failed_code != 0) {
|
||||
json j;
|
||||
j["stage"] = std::to_string(m_last_state);
|
||||
j["dev_id"] = m_machine;
|
||||
j["dev_ip"] = m_lan_ip;
|
||||
j["result"] = "failed";
|
||||
j["code"] = m_failed_code;
|
||||
NetworkAgent* agent = wxGetApp().getAgent();
|
||||
if (agent)
|
||||
agent->track_event("start_liveview", j.dump());
|
||||
}
|
||||
|
||||
++m_failed_retry;
|
||||
if (m_failed_code != 0 && !m_tutk_support && (m_failed_retry > 1 || m_user_triggered)) {
|
||||
m_next_retry = wxDateTime(); // stop retry
|
||||
|
@ -369,6 +382,18 @@ void MediaPlayCtrl::onStateChanged(wxMediaEvent &event)
|
|||
if (size.GetWidth() > 1000) {
|
||||
m_last_state = state;
|
||||
SetStatus(_L("Playing..."), false);
|
||||
|
||||
// track event
|
||||
json j;
|
||||
j["stage"] = std::to_string(m_last_state);
|
||||
j["dev_id"] = m_machine;
|
||||
j["dev_ip"] = m_lan_ip;
|
||||
j["result"] = "success";
|
||||
j["code"] = 0;
|
||||
NetworkAgent* agent = wxGetApp().getAgent();
|
||||
if (agent)
|
||||
agent->track_event("start_liveview", j.dump());
|
||||
|
||||
m_failed_retry = 0;
|
||||
m_failed_code = 0;
|
||||
boost::unique_lock lock(m_mutex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue