Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions onnxruntime/core/platform/telemetry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ void Telemetry::SetLanguageProjection(uint32_t projection) const {
void Telemetry::LogProcessInfo() const {
}

void Telemetry::LogSessionCreationStart() const {
void Telemetry::LogSessionCreationStart(uint32_t session_id) const {
ORT_UNUSED_PARAMETER(session_id);
}

void Telemetry::LogEvaluationStop() const {
void Telemetry::LogEvaluationStop(uint32_t session_id) const {
ORT_UNUSED_PARAMETER(session_id);
}

void Telemetry::LogEvaluationStart() const {
void Telemetry::LogEvaluationStart(uint32_t session_id) const {
ORT_UNUSED_PARAMETER(session_id);
}

void Telemetry::LogSessionCreation(uint32_t session_id, int64_t ir_version, const std::string& model_producer_name,
Expand Down
6 changes: 3 additions & 3 deletions onnxruntime/core/platform/telemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ class Telemetry {

virtual void LogProcessInfo() const;

virtual void LogSessionCreationStart() const;
virtual void LogSessionCreationStart(uint32_t session_id) const;

virtual void LogEvaluationStop() const;
virtual void LogEvaluationStop(uint32_t session_id) const;

virtual void LogEvaluationStart() const;
virtual void LogEvaluationStart(uint32_t session_id) const;

virtual void LogSessionCreation(uint32_t session_id, int64_t ir_version, const std::string& model_producer_name,
const std::string& model_producer_version, const std::string& model_domain,
Expand Down
13 changes: 8 additions & 5 deletions onnxruntime/core/platform/windows/telemetry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void WindowsTelemetry::LogProcessInfo() const {
process_info_logged = true;
}

void WindowsTelemetry::LogSessionCreationStart() const {
void WindowsTelemetry::LogSessionCreationStart(uint32_t session_id) const {
if (global_register_count_ == 0 || enabled_ == false)
return;

Expand All @@ -203,23 +203,26 @@ void WindowsTelemetry::LogSessionCreationStart() const {
TraceLoggingBool(true, "UTCReplace_AppSessionGuid"),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TraceLoggingUInt32(session_id, "sessionId"),
TraceLoggingLevel(WINEVENT_LEVEL_INFO));
}

void WindowsTelemetry::LogEvaluationStop() const {
void WindowsTelemetry::LogEvaluationStop(uint32_t session_id) const {
if (global_register_count_ == 0 || enabled_ == false)
return;

TraceLoggingWrite(telemetry_provider_handle,
"EvaluationStop");
"EvaluationStop",
TraceLoggingUInt32(session_id, "sessionId"));
}

void WindowsTelemetry::LogEvaluationStart() const {
void WindowsTelemetry::LogEvaluationStart(uint32_t session_id) const {
if (global_register_count_ == 0 || enabled_ == false)
return;

TraceLoggingWrite(telemetry_provider_handle,
"EvaluationStart");
"EvaluationStart",
TraceLoggingUInt32(session_id, "sessionId"));
}

void WindowsTelemetry::LogSessionCreation(uint32_t session_id, int64_t ir_version, const std::string& model_producer_name,
Expand Down
6 changes: 3 additions & 3 deletions onnxruntime/core/platform/windows/telemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ class WindowsTelemetry : public Telemetry {

void LogProcessInfo() const override;

void LogSessionCreationStart() const override;
void LogSessionCreationStart(uint32_t session_id) const override;

void LogEvaluationStop() const override;
void LogEvaluationStop(uint32_t session_id) const override;

void LogEvaluationStart() const override;
void LogEvaluationStart(uint32_t session_id) const override;

void LogSessionCreation(uint32_t session_id, int64_t ir_version, const std::string& model_producer_name,
const std::string& model_producer_version, const std::string& model_domain,
Expand Down
6 changes: 3 additions & 3 deletions onnxruntime/core/session/inference_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ common::Status InferenceSession::Initialize() {
ORT_TRY {
LOGS(*session_logger_, INFO) << "Initializing session.";
const Env& env = Env::Default();
env.GetTelemetryProvider().LogSessionCreationStart();
env.GetTelemetryProvider().LogSessionCreationStart(session_id_);

bool have_cpu_ep = false;

Expand Down Expand Up @@ -2955,7 +2955,7 @@ Status InferenceSession::Run(const RunOptions& run_options,
}

// log evaluation start to trace logging provider
env.GetTelemetryProvider().LogEvaluationStart();
env.GetTelemetryProvider().LogEvaluationStart(session_id_);

ORT_RETURN_IF_ERROR_SESSIONID_(ValidateInputs(feed_names, feeds));
ORT_RETURN_IF_ERROR_SESSIONID_(ValidateOutputs(output_names, p_fetches));
Expand Down Expand Up @@ -3108,7 +3108,7 @@ Status InferenceSession::Run(const RunOptions& run_options,
}

// log evaluation stop to trace logging provider
env.GetTelemetryProvider().LogEvaluationStop();
env.GetTelemetryProvider().LogEvaluationStop(session_id_);

// send out profiling events (optional)
if (session_profiler_.IsEnabled()) {
Expand Down
Loading