-
Notifications
You must be signed in to change notification settings - Fork 770
feat: add time series statistics profile #17809
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
base: main
Are you sure you want to change the base?
Conversation
971528e
to
dfdef76
Compare
Docker Image for PR
|
Disabled in log by default. Enable by adding
|
3cf1865
to
a0ecd35
Compare
Docker Image for PR
|
This reverts commit dc7fb59.
@zhang2014 Benchmark looks good. Please take a look again |
profile.statistics[name as usize].fetch_add(value, Ordering::SeqCst); | ||
let previous_value = | ||
profile.statistics[name.clone() as usize].fetch_add(value, Ordering::SeqCst); | ||
if let Some(time_series_profile) = &profile.time_series { |
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.
add record_timeseries_profile
function is better?
} | ||
|
||
pub fn finish(&self) { | ||
for item in self.items.iter() { |
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.
Maybe need record last point?
let mut items = Vec::with_capacity(len); | ||
for i in 0..len { | ||
items.push(TimeSeriesProfileItem { | ||
queue: ConcurrentQueue::unbounded(), |
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.
queue: ConcurrentQueue::unbounded(), | |
queue: ConcurrentQueue::bounded(DEFAULT_BATCH_SIZE), |
Ordering::SeqCst, | ||
) { | ||
Ok(_) => { | ||
item.queue |
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.
flush if queue is full
let previous_value = | ||
profile.statistics[name.clone() as usize].fetch_add(value, Ordering::SeqCst); | ||
if let Some(time_series_profile) = &profile.time_series { | ||
time_series_profile.record_point(name, previous_value + value); |
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.
losting data.
pub stats_name: String, | ||
pub stats: Vec<(usize, usize)>, | ||
} | ||
info!( |
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.
too many logs.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
close: #17779
Add time series statistics profile. Iniaitily, we support output_rows and output_bytes. This allows us to visualize and compare the data processing speed of different plan nodes.
Tests
Type of change
This change is