-
Notifications
You must be signed in to change notification settings - Fork 20
Generate CPU Enhanced Metrics #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
07ec029
84e36ae
bd08c90
50eb2d3
3423c57
d4ad790
16646ed
4190332
66c6dee
73866e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -425,8 +425,9 @@ async fn extension_loop_active( | |
| .. | ||
| } => { | ||
| let mut p = invocation_processor.lock().await; | ||
| let mut enhanced_metric_data = None; | ||
| if let Some(metrics) = metrics { | ||
| p.on_platform_runtime_done( | ||
| enhanced_metric_data = p.on_platform_runtime_done( | ||
| &request_id, | ||
| metrics.duration_ms, | ||
| config.clone(), | ||
|
|
@@ -450,6 +451,11 @@ async fn extension_loop_active( | |
| request_id, status | ||
| ); | ||
|
|
||
| // set cpu utilization metrics here to avoid accounting for extra idle time | ||
| if let Some(offsets) = enhanced_metric_data { | ||
| lambda_enhanced_metrics.set_cpu_utilization_enhanced_metrics(offsets.cpu_offset, offsets.uptime_offset); | ||
| } | ||
|
|
||
| // TODO(astuyve) it'll be easy to | ||
| // pass the invocation deadline to | ||
| // flush tasks here, so they can | ||
|
|
@@ -462,6 +468,7 @@ async fn extension_loop_active( | |
| stats_flusher.manual_flush() | ||
| ); | ||
| } | ||
|
|
||
| break; | ||
| } | ||
| TelemetryRecord::PlatformReport { | ||
|
|
@@ -476,11 +483,13 @@ async fn extension_loop_active( | |
| ); | ||
| lambda_enhanced_metrics.set_report_log_metrics(&metrics); | ||
| let mut p = invocation_processor.lock().await; | ||
| if let Some((post_runtime_duration_ms, network_offset)) = p.on_platform_report(&request_id, metrics.duration_ms) { | ||
| lambda_enhanced_metrics.set_post_runtime_duration_metric( | ||
| post_runtime_duration_ms, | ||
| ); | ||
| lambda_enhanced_metrics.set_network_enhanced_metrics(network_offset); | ||
| let (post_runtime_duration_ms, enhanced_metric_data) = p.on_platform_report(&request_id, metrics.duration_ms); | ||
| if let Some(duration) = post_runtime_duration_ms { | ||
| lambda_enhanced_metrics.set_post_runtime_duration_metric(duration); | ||
| } | ||
| if let Some(offsets) = enhanced_metric_data { | ||
| lambda_enhanced_metrics.set_network_enhanced_metrics(offsets.network_offset); | ||
| lambda_enhanced_metrics.set_cpu_time_enhanced_metrics(offsets.cpu_offset); | ||
| } | ||
| drop(p); | ||
|
Comment on lines
+487
to
494
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I understand why are we not doing the some as before?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realized that we were returning None for both |
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these stuff like configs and tags provider could be set once at initialization of the invocation_processor, rather than cloned continuously
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I'll be doing some refactoring in my next PR, so I can look into that then