proxy: change is cold start to enum (#6948)

## Problem

Actually it's good idea to distinguish between cases when it's a cold
start, but we took the compute from the pool

## Summary of changes

Updated to enum.
This commit is contained in:
Anna Khanova
2024-03-04 13:31:28 +04:00
committed by GitHub
parent 8dc7dc79dd
commit 3114be034a
3 changed files with 55 additions and 42 deletions

View File

@@ -9,7 +9,7 @@ use tracing::{field::display, info_span, Span};
use uuid::Uuid;
use crate::{
console::messages::MetricsAuxInfo,
console::messages::{ColdStartInfo, MetricsAuxInfo},
error::ErrorKind,
metrics::{LatencyTimer, ENDPOINT_ERRORS_BY_KIND, ERROR_BY_KIND},
BranchId, DbName, EndpointId, ProjectId, RoleName,
@@ -42,7 +42,7 @@ pub struct RequestMonitoring {
error_kind: Option<ErrorKind>,
pub(crate) auth_method: Option<AuthMethod>,
success: bool,
is_cold_start: Option<bool>,
cold_start_info: Option<ColdStartInfo>,
// extra
// This sender is here to keep the request monitoring channel open while requests are taking place.
@@ -91,7 +91,7 @@ impl RequestMonitoring {
error_kind: None,
auth_method: None,
success: false,
is_cold_start: None,
cold_start_info: None,
sender: LOG_CHAN.get().and_then(|tx| tx.upgrade()),
latency_timer: LatencyTimer::new(protocol),
@@ -115,7 +115,7 @@ impl RequestMonitoring {
self.set_endpoint_id(x.endpoint_id);
self.branch = Some(x.branch_id);
self.project = Some(x.project_id);
self.is_cold_start = x.is_cold_start;
self.cold_start_info = x.cold_start_info;
}
pub fn set_project_id(&mut self, project_id: ProjectId) {