docs: Fix typos (#4492)

This commit is contained in:
John Vandenberg 2024-09-22 17:57:47 +08:00 committed by GitHub
parent 74dd5d8595
commit d0079bb9bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
47 changed files with 239 additions and 149 deletions

35
.typos.toml Normal file
View File

@ -0,0 +1,35 @@
# See https://github.com/crate-ci/typos/blob/master/docs/reference.md to configure typos
[default]
extend-ignore-re = [
# 'recepients' was a typo in the codebase, that has been fixed but is needed inside quotes for backwards compatibility
'"recepients"',
"flate2", # dependency name
"eni-03c0f5ba79a66ef17", # Test data
"NdJsonFormat", # Used in .proto files
'"author": "[^"]+"', # Used in web/sbom.json
"cohabitatingResource[12]",
# The following are typos yet to be fixed
"custom_error_handeling",
"organizationIdetifier",
"udpateQuery",
"resetFunctionDefination",
"machedRoutes",
"seachCollapseImage",
]
[default.extend-words]
childs = "childs" # Used in the frontend code
wheres = "wheres" # typos incorrectly recommends replacing with 'whereas'
[files]
extend-exclude = [
"bom.json",
"web/sbom.json",
"web/src/locales/languages/",
"ua_regex/regexes.yaml",
"tests/ui-testing/cypress/fixtures/enrichment_info.csv",
"*.vue",
"*.js",
"*.ts",
]

View File

@ -136,7 +136,7 @@ We check for following in CI pipeline for any pull requests.
- Run `cargo llvm-cov --lcov --output-path lcov.info` to generate report and use [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) with VS code for visualizing code coverage.
- You can also generate html report by using `cargo llvm-cov --html` to generate html report in target/debug/llvm-cov/html/index.html
1. Linting in Javascript for GUI
- We run eslint for javascript anf any linting failures will result in build failures.
- We run eslint for javascript and any linting failures will result in build failures.
- You can test for linting failures by running `./eslint.sh` in web folder.
## How to contribute code

1
Cargo.lock generated
View File

@ -6779,6 +6779,7 @@ dependencies = [
"log",
"once_cell",
"serde",
"serde_json",
"tempfile",
"tokio",
]

View File

@ -5974,7 +5974,7 @@
<component type="library" bom-ref="registry+https://github.com/rust-lang/crates.io-index#http-auth-basic@0.3.3">
<name>http-auth-basic</name>
<version>0.3.3</version>
<description>HTTP Basic Authentication Scheme (RFC 7617 and RFC 2617 compilant, base64-encoded credentials) for Rust applications</description>
<description>HTTP Basic Authentication Scheme (RFC 7617 and RFC 2617 compliant, base64-encoded credentials) for Rust applications</description>
<scope>required</scope>
<hashes>
<hash alg="SHA-256">dd2e17aacf7f4a2428def798e2ff4f4f883c0987bdaf47dd5c8bc027bc9f1ebc</hash>

View File

@ -185,7 +185,10 @@ pub async fn cli() -> Result<bool, anyhow::Error> {
.expect("file list remote calculate stats failed");
}
_ => {
return Err(anyhow::anyhow!("unsupport reset component: {}", component));
return Err(anyhow::anyhow!(
"unsupported reset component: {}",
component
));
}
}
}
@ -204,7 +207,7 @@ pub async fn cli() -> Result<bool, anyhow::Error> {
}
}
_ => {
return Err(anyhow::anyhow!("unsupport reset component: {component}"));
return Err(anyhow::anyhow!("unsupported reset component: {component}"));
}
}
}
@ -265,7 +268,7 @@ pub async fn cli() -> Result<bool, anyhow::Error> {
migration::schema::run().await?
}
_ => {
return Err(anyhow::anyhow!("unsupport sub command: {name}"));
return Err(anyhow::anyhow!("unsupported sub command: {name}"));
}
}

View File

@ -134,15 +134,15 @@ pub async fn init() -> Result<(), anyhow::Error> {
if !key.contains('/') {
continue;
}
let key_splitted = key.split('/').collect::<Vec<&str>>();
let org_name = key_splitted[0];
let split_key = key.split('/').collect::<Vec<&str>>();
let org_name = split_key[0];
orgs.insert(org_name);
if need_migrate_index_streams
&& key_splitted.len() > 2
&& key_splitted[1] == "index"
&& split_key.len() > 2
&& split_key[1] == "index"
&& !migrate_native_objects
{
get_tuple_for_new_index(org_name, key_splitted[2], &mut tuples);
get_tuple_for_new_index(org_name, split_key[2], &mut tuples);
}
}
if migrate_native_objects {

View File

@ -198,8 +198,10 @@ impl Default for Report {
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[cfg_attr(test, derive(PartialEq))]
pub struct ReportEmailDetails {
pub recepients: Vec<String>,
#[serde(alias = "recepients")]
pub recipients: Vec<String>,
pub title: String,
pub name: String,
pub message: String,
@ -218,3 +220,25 @@ pub struct ReportListFilters {
pub folder: Option<String>,
pub destination_less: Option<bool>,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_recipients_backwards_compatibility() {
// The serde alias allows loading data created before the typo was fixed.
let email_details = ReportEmailDetails {
recipients: vec!["foo@example.com".to_string()],
title: "title".to_string(),
name: "name".to_string(),
message: "message".to_string(),
dashb_url: "https://example.com/dashb_url".to_string(),
};
let json = serde_json::to_string(&email_details).unwrap();
let json_using_alias = json.replace("recipients", "recepients");
let email_details_from_alias: ReportEmailDetails =
serde_json::from_str(&json_using_alias).unwrap();
assert_eq!(email_details, email_details_from_alias);
}
}

View File

@ -243,7 +243,7 @@ mod tests {
/// Test logic for IP parsing
#[test]
fn test_ip_parsing() {
let valid_addressses = vec![
let valid_addresses = vec![
"127.0.0.1",
"127.0.0.1:8080",
"::1",
@ -252,7 +252,7 @@ mod tests {
"[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:8080",
];
let parsed_addresses: Vec<IpAddr> = valid_addressses
let parsed_addresses: Vec<IpAddr> = valid_addresses
.iter()
.map(|ip_addr| parse_ip_addr(ip_addr).unwrap().0)
.collect();
@ -260,7 +260,7 @@ mod tests {
assert!(
parsed_addresses
.iter()
.zip(valid_addressses)
.zip(valid_addresses)
.map(|(parsed, original)| original.contains(parsed.to_string().as_str()))
.fold(true, |acc, x| { acc | x })
);

View File

@ -62,7 +62,7 @@ impl<W> PuffinBytesWriter<W> {
.offset(self.written_bytes as _)
.length(size as _)
.build()
.expect("Missing required fileds")
.expect("Missing required fields")
}
}

View File

@ -345,7 +345,7 @@ mod tests {
#[test]
fn complex_key_format() {
let datas = [
let data = [
(
json!({"key": "value", "nested_key": {"key": "value", "foo": "bar"}}),
json!({"key": "value", "nested_key_key": "value", "nested_key_foo": "bar"}),
@ -359,7 +359,7 @@ mod tests {
json!({"a_a_1": "[1,[3,4],5]", "a_a_2": 6}),
),
];
for (input, expected) in datas.into_iter() {
for (input, expected) in data.into_iter() {
assert_eq!(flatten(input).unwrap(), expected);
}
}

View File

@ -27,7 +27,7 @@ pub fn find(haystack: &str, needle: &str) -> bool {
pub trait StringExt {
fn find(&self, needle: &str) -> bool;
fn optinal(&self) -> Option<String>;
fn optional(&self) -> Option<String>;
}
impl StringExt for String {
@ -36,7 +36,7 @@ impl StringExt for String {
find(self, needle)
}
fn optinal(&self) -> Option<String> {
fn optional(&self) -> Option<String> {
if self.is_empty() {
None
} else {

View File

@ -131,7 +131,7 @@ struct Rum {
path = "/healthz",
tag = "Meta",
responses(
(status = 200, description="Staus OK", content_type = "application/json", body = HealthzResponse, example = json!({"status": "ok"}))
(status = 200, description="Status OK", content_type = "application/json", body = HealthzResponse, example = json!({"status": "ok"}))
)
)]
#[get("/healthz")]
@ -146,8 +146,8 @@ pub async fn healthz() -> Result<HttpResponse, Error> {
path = "/schedulez",
tag = "Meta",
responses(
(status = 200, description="Staus OK", content_type = "application/json", body = HealthzResponse, example = json!({"status": "ok"})),
(status = 404, description="Staus Not OK", content_type = "application/json", body = HealthzResponse, example = json!({"status": "not ok"})),
(status = 200, description="Status OK", content_type = "application/json", body = HealthzResponse, example = json!({"status": "ok"})),
(status = 404, description="Status Not OK", content_type = "application/json", body = HealthzResponse, example = json!({"status": "not ok"})),
)
)]
#[get("/schedulez")]
@ -339,7 +339,7 @@ pub async fn config_reload() -> Result<HttpResponse, Error> {
HttpResponse::InternalServerError().json(serde_json::json!({"status": e.to_string()}))
);
}
let status = "succcessfully reloaded config";
let status = "successfully reloaded config";
// Audit this event
#[cfg(feature = "enterprise")]
audit(AuditMessage {

View File

@ -40,11 +40,11 @@ static FILES: Lazy<Vec<RwLock<FileData>>> = Lazy::new(|| {
});
static DATA: Lazy<Vec<RwHashMap<String, Bytes>>> = Lazy::new(|| {
let cfg = get_config();
let mut datas = Vec::with_capacity(cfg.memory_cache.bucket_num);
let mut data = Vec::with_capacity(cfg.memory_cache.bucket_num);
for _ in 0..cfg.memory_cache.bucket_num {
datas.push(Default::default());
data.push(Default::default());
}
datas
data
});
pub struct FileData {

View File

@ -774,7 +774,7 @@ impl Locker {
if let Some(err) = last_err {
if err.contains("key already exists") {
Err(Error::Message(format!(
"nats lock for key: {}, accquire timeout in {timeout}s",
"nats lock for key: {}, acquire timeout in {timeout}s",
self.key
)))
} else {

View File

@ -168,7 +168,7 @@ pub async fn update_trigger(trigger: Trigger) -> Result<()> {
/// - trigger.status == "Waiting"
///
/// `concurrency` - Defines the maximum number of jobs to pull at a time.
/// `timeout` - Used to set the maximum time duration the job executation can take.
/// `timeout` - Used to set the maximum time duration the job execution can take.
/// This is used to calculate the `end_time` of the trigger.
#[inline]
pub async fn pull(

View File

@ -187,7 +187,7 @@ INSERT IGNORE INTO scheduled_jobs (org, module, module_key, is_realtime, is_sile
if module == TriggerModule::Alert {
// It will send event even if the alert is not realtime alert.
// But that is okay, for non-realtime alerts, since the triggers are not
// present in the cache at all, it will just do nothin.
// present in the cache at all, it will just do nothing.
let key = format!("{TRIGGERS_KEY}{}/{}/{}", module, org, key);
let cluster_coordinator = db::get_coordinator().await;
cluster_coordinator.delete(&key, false, true, None).await?;

View File

@ -185,7 +185,7 @@ INSERT INTO scheduled_jobs (org, module, module_key, is_realtime, is_silenced, s
if module == TriggerModule::Alert {
// It will send event even if the alert is not realtime alert.
// But that is okay, for non-realtime alerts, since the triggers are not
// present in the cache at all, it will just do nothin.
// present in the cache at all, it will just do nothing.
let key = format!("{TRIGGERS_KEY}{}/{}/{}", module, org, key);
let cluster_coordinator = db::get_coordinator().await;
cluster_coordinator.delete(&key, false, true, None).await?;

View File

@ -51,7 +51,7 @@ pub async fn run() -> Result<(), anyhow::Error> {
}
}
let cluster_name = config::get_cluster_name();
// regester to super cluster
// register to super cluster
o2_enterprise::enterprise::super_cluster::kv::alert_manager::register_job_cluster(
&cluster_name,
)

View File

@ -329,7 +329,7 @@ async fn main() -> Result<(), anyhow::Error> {
}
log::info!("HTTP server stopped");
// flush useage report
// flush usage report
usage::flush().await;
// leave the cluster

View File

@ -17,4 +17,7 @@ chromiumoxide.workspace=true
once_cell.workspace=true
lettre.workspace=true
chrono.workspace=true
futures.workspace=true
futures.workspace=true
[dev-dependencies]
serde_json.workspace = true

View File

@ -9,8 +9,10 @@ pub struct SmtpConfig {
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[cfg_attr(test, derive(PartialEq))]
pub struct EmailDetails {
pub recepients: Vec<String>,
#[serde(alias = "recepients")]
pub recipients: Vec<String>,
pub title: String,
pub name: String,
pub message: String,
@ -77,3 +79,25 @@ impl Default for ReportTimerange {
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_recipients_backwards_compatibility() {
// The serde alias allows loading data created before the typo was fixed.
let email_details = EmailDetails {
recipients: vec!["foo@example.com".to_string()],
title: "title".to_string(),
name: "name".to_string(),
message: "message".to_string(),
dashb_url: "https://example.com/dashb_url".to_string(),
};
let json = serde_json::to_string(&email_details).unwrap();
let json_using_alias = json.replace("recipients", "recepients");
let email_details_from_alias: EmailDetails =
serde_json::from_str(&json_using_alias).unwrap();
assert_eq!(email_details, email_details_from_alias);
}
}

View File

@ -372,23 +372,23 @@ pub async fn generate_report(
Ok((pdf_data, email_dashb_url))
}
/// Sends emails to the [`Report`] recepients. Currently only one pdf data is supported.
/// Sends emails to the [`Report`] recipients. Currently only one pdf data is supported.
pub async fn send_email(
pdf_data: &[u8],
email_details: models::EmailDetails,
config: models::SmtpConfig,
) -> Result<(), anyhow::Error> {
let mut recepients = vec![];
for recepient in &email_details.recepients {
recepients.push(recepient);
let mut recipients = vec![];
for recipient in &email_details.recipients {
recipients.push(recipient);
}
let mut email = Message::builder()
.from(config.from_email.parse()?)
.subject(format!("Openobserve Report - {}", &email_details.title));
for recepient in recepients {
email = email.to(recepient.parse()?);
for recipient in recipients {
email = email.to(recipient.parse()?);
}
if !config.reply_to.is_empty() {

View File

@ -66,7 +66,7 @@ pub async fn send_report(
};
let cfg = config::get_config();
let report_type = if report.email_details.recepients.is_empty() {
let report_type = if report.email_details.recipients.is_empty() {
ReportType::Cache
} else {
ReportType::PDF
@ -115,7 +115,7 @@ pub async fn send_report(
"report sent to emails successfully".into(),
))),
Err(e) => {
log::error!("Error sending emails to recepients: {e}");
log::error!("Error sending emails to recipients: {e}");
Ok(ActixHttpResponse::InternalServerError()
.json(HttpResponse::internal_server_error(e.to_string())))
}

View File

@ -516,17 +516,17 @@ pub async fn send_email_notification(
return Err(anyhow::anyhow!("SMTP configuration not enabled"));
}
let mut recepients = vec![];
for recepient in &dest.emails {
recepients.push(recepient);
let mut recipients = vec![];
for recipient in &dest.emails {
recipients.push(recipient);
}
let mut email = Message::builder()
.from(cfg.smtp.smtp_from_email.parse()?)
.subject(format!("Openobserve Alert - {}", alert_name));
for recepient in recepients {
email = email.to(recepient.parse()?);
for recipient in recipients {
email = email.to(recipient.parse()?);
}
if !cfg.smtp.smtp_reply_to.is_empty() {

View File

@ -114,7 +114,7 @@ pub async fn run_merge(offset: i64) -> Result<(), anyhow::Error> {
}
if is_waiting_streams {
// compact zero hour for daily partiton
// compact zero hour for daily partition
let time_zero_hour = Utc
.with_ymd_and_hms(time_now.year(), time_now.month(), time_now.day(), 0, 0, 0)
.unwrap()
@ -143,7 +143,7 @@ pub async fn run_merge(offset: i64) -> Result<(), anyhow::Error> {
return Ok(());
}
// compact zero hour for daily partiton
// compact zero hour for daily partition
let offset_zero_hour = Utc
.with_ymd_and_hms(
offset_time.year(),

View File

@ -353,7 +353,7 @@ pub async fn merge_by_stream(
// collect stream stats
let mut stream_stats = StreamStats::default();
// use mutiple threads to merge
// use multiple threads to merge
let semaphore = std::sync::Arc::new(Semaphore::new(cfg.limit.file_merge_thread_num));
let mut tasks = Vec::with_capacity(partition_files_with_size.len());
for (prefix, files_with_size) in partition_files_with_size.into_iter() {
@ -688,7 +688,7 @@ pub async fn merge_files(
if schema_ver_id == schema_latest_id {
continue;
}
// cacluate the diff between latest schema and current schema
// calculate the diff between latest schema and current schema
let schema = schema_versions[schema_ver_id]
.clone()
.with_metadata(HashMap::new());

View File

@ -293,19 +293,19 @@ impl Report {
}
let cfg = get_config();
let mut recepients = vec![];
for recepient in &self.destinations {
match recepient {
ReportDestination::Email(email) => recepients.push(email.clone()),
let mut recipients = vec![];
for recipient in &self.destinations {
match recipient {
ReportDestination::Email(email) => recipients.push(email.clone()),
}
}
let no_of_recepients = recepients.len();
let no_of_recipients = recipients.len();
if !cfg.common.report_server_url.is_empty() {
let report_data = HttpReportPayload {
dashboards: self.dashboards.clone(),
email_details: ReportEmailDetails {
title: self.title.clone(),
recepients,
recipients,
name: self.name.clone(),
message: self.message.clone(),
dashb_url: format!("{}{}/web", cfg.common.web_url, cfg.common.base_uri),
@ -351,28 +351,28 @@ impl Report {
&cfg.common.report_user_name,
&cfg.common.report_user_password,
&self.timezone,
no_of_recepients,
no_of_recipients,
)
.await?;
self.send_email(&report.0, report.1).await
}
}
/// Sends emails to the [`Report`] recepients. Currently only one pdf data is supported.
/// Sends emails to the [`Report`] recipients. Currently only one pdf data is supported.
async fn send_email(&self, pdf_data: &[u8], dashb_url: String) -> Result<(), anyhow::Error> {
let cfg = get_config();
if !cfg.smtp.smtp_enabled {
return Err(anyhow::anyhow!("SMTP configuration not enabled"));
}
let mut recepients = vec![];
for recepient in &self.destinations {
match recepient {
ReportDestination::Email(email) => recepients.push(email),
let mut recipients = vec![];
for recipient in &self.destinations {
match recipient {
ReportDestination::Email(email) => recipients.push(email),
}
}
if recepients.is_empty() {
if recipients.is_empty() {
return Ok(());
}
@ -380,8 +380,8 @@ impl Report {
.from(cfg.smtp.smtp_from_email.parse()?)
.subject(format!("Openobserve Report - {}", &self.title));
for recepient in recepients {
email = email.to(recepient.parse()?);
for recipient in recipients {
email = email.to(recipient.parse()?);
}
if !cfg.smtp.smtp_reply_to.is_empty() {
@ -422,7 +422,7 @@ async fn generate_report(
user_id: &str,
user_pass: &str,
timezone: &str,
no_of_recepients: usize,
no_of_recipients: usize,
) -> Result<(Vec<u8>, String), anyhow::Error> {
let cfg = get_config();
// Check if Chrome is enabled, otherwise don't save the report
@ -488,7 +488,7 @@ async fn generate_report(
tokio::time::sleep(Duration::from_secs(5)).await;
let timerange = &dashboard.timerange;
let search_type = if no_of_recepients == 0 {
let search_type = if no_of_recipients == 0 {
"ui"
} else {
"reports"
@ -601,7 +601,7 @@ async fn generate_report(
// Last two elements loaded means atleast the metric components have loaded.
// Convert the page into pdf
let pdf_data = if no_of_recepients != 0 {
let pdf_data = if no_of_recipients != 0 {
page.pdf(PrintToPdfParams {
landscape: Some(true),
..Default::default()

View File

@ -152,7 +152,7 @@ async fn send_to_node(
// connect to the node
let token: MetadataValue<_> = get_internal_grpc_token()
.parse()
.expect("parse internal grpc token faile");
.expect("parse internal grpc token failed");
let channel = match get_cached_channel(&node.grpc_addr).await {
Ok(v) => v,
Err(e) => {

View File

@ -273,11 +273,11 @@ pub async fn watch() -> Result<(), anyhow::Error> {
};
match ev {
db::Event::Put(ev) => {
let key_cloumns = ev.key.split('/').collect::<Vec<&str>>();
let (ev_key, ev_start_dt) = if key_cloumns.len() > 5 {
let key_columns = ev.key.split('/').collect::<Vec<&str>>();
let (ev_key, ev_start_dt) = if key_columns.len() > 5 {
(
key_cloumns[..5].join("/"),
key_cloumns[5].parse::<i64>().unwrap_or(0),
key_columns[..5].join("/"),
key_columns[5].parse::<i64>().unwrap_or(0),
)
} else {
(ev.key.to_string(), ev.start_dt.unwrap_or_default())

View File

@ -208,7 +208,7 @@ pub async fn save_enrichment_data(
log::error!("ingestion error while syncing writer: {}", e);
}
// notifiy update
// notify update
if stream_schema.has_fields {
if let Err(e) = super::db::enrichment_table::notify_update(org_id, stream_name).await {
log::error!("Error notifying enrichment table {org_id}/{stream_name} update: {e}");

View File

@ -205,7 +205,7 @@ pub async fn handle_grpc_request(
None => vec![],
};
// udpate schema metadata
// update schema metadata
if !schema_exists.has_metadata {
if let Err(e) =
update_setting(org_id, metric_name, StreamType::Metrics, prom_meta).await

View File

@ -284,7 +284,7 @@ pub async fn metrics_json_handler(
continue;
};
// udpate schema metadata
// update schema metadata
if !schema_exists.has_metadata {
if let Err(e) =
update_setting(org_id, metric_name, StreamType::Metrics, prom_meta)

View File

@ -223,7 +223,7 @@ fn vector_and(expr: &BinaryExpr, left: &[InstantValue], right: &[InstantValue])
Ok(Value::Vector(output))
}
fn vector_arithmatic_operators(
fn vector_arithmetic_operators(
expr: &BinaryExpr,
left: &[InstantValue],
right: &[InstantValue],
@ -352,6 +352,6 @@ pub fn vector_bin_op(
token::T_LAND => vector_and(expr, left, right),
token::T_LOR => vector_or(expr, left, right),
token::T_LUNLESS => vector_unless(expr, left, right),
_ => vector_arithmatic_operators(expr, left, right),
_ => vector_arithmetic_operators(expr, left, right),
}
}

View File

@ -692,7 +692,7 @@ mod tests {
let value = labels.get_value("a");
assert!(value == "1");
let value = labels.get_value("non-existant-label");
let value = labels.get_value("non-existent-label");
assert!(value.is_empty());
}

View File

@ -51,7 +51,7 @@ pub(crate) fn get_request_columns_limit_error(
num_fields: usize,
) -> anyhow::Error {
anyhow::anyhow!(
"Got {num_fields} columns for stream {stream_name}, only {} columns accept. Data discarded. You can adjust ingestion columns limit by setting the environment variable ZO_COLS_PER_RECORD_LIMIT=<max_cloumns>",
"Got {num_fields} columns for stream {stream_name}, only {} columns accept. Data discarded. You can adjust ingestion columns limit by setting the environment variable ZO_COLS_PER_RECORD_LIMIT=<max_columns>",
get_config().limit.req_cols_per_record_limit
)
}

View File

@ -119,7 +119,7 @@ pub async fn check_cache(
} else {
sql.time_range
};
handle_historgram(origin_sql, q_time_range);
handle_histogram(origin_sql, q_time_range);
req.query.sql = origin_sql.clone();
discard_interval = interval * 1000 * 1000; //in microseconds
}
@ -589,7 +589,7 @@ pub async fn delete_cache(path: &str) -> std::io::Result<bool> {
Ok(true)
}
fn handle_historgram(origin_sql: &mut String, q_time_range: Option<(i64, i64)>) {
fn handle_histogram(origin_sql: &mut String, q_time_range: Option<(i64, i64)>) {
let caps = RE_HISTOGRAM.captures(origin_sql.as_str()).unwrap();
let attrs = caps
.get(1)

View File

@ -226,11 +226,11 @@ pub async fn get_cached_results(
all_results.extend(res);
}
let mut results = Vec::new();
recursive_process_muliple_metas(&all_results, cache_req.clone(), &mut results);
recursive_process_multiple_metas(&all_results, cache_req.clone(), &mut results);
results
}
fn recursive_process_muliple_metas(
fn recursive_process_multiple_metas(
cache_metas: &[CachedQueryResponse],
cache_req: CacheQueryRequest,
results: &mut Vec<CachedQueryResponse>,
@ -278,7 +278,7 @@ fn recursive_process_muliple_metas(
if remaining_metas.is_empty() {
return;
}
recursive_process_muliple_metas(&remaining_metas, cache_req, results);
recursive_process_multiple_metas(&remaining_metas, cache_req, results);
}
}

View File

@ -32,13 +32,13 @@ use datafusion::{
pub struct AddSortAndLimitRule {
#[allow(dead_code)]
limit: usize,
offest: usize,
offset: usize,
}
impl AddSortAndLimitRule {
#[allow(missing_docs)]
pub fn new(limit: usize, offest: usize) -> Self {
Self { limit, offest }
pub fn new(limit: usize, offset: usize) -> Self {
Self { limit, offset }
}
}
@ -92,7 +92,7 @@ impl OptimizerRule for AddSortAndLimitRule {
let plan = generate_limit_plan(
Arc::new(LogicalPlan::Sort(sort)),
self.limit,
self.offest,
self.offset,
);
(Transformed::yes(plan), None)
}
@ -103,13 +103,13 @@ impl OptimizerRule for AddSortAndLimitRule {
Transformed::yes(generate_limit_plan(
Arc::new(plan),
self.limit,
self.offest,
self.offset,
)),
None,
)
} else {
let (plan, schema) =
generate_limit_and_sort_plan(Arc::new(plan), self.limit, self.offest);
generate_limit_and_sort_plan(Arc::new(plan), self.limit, self.offset);
(Transformed::yes(plan), schema)
}
}

View File

@ -54,7 +54,7 @@ pub fn generate_optimizer_rules(sql: &Sql) -> Vec<Arc<dyn OptimizerRule + Send +
} else {
None
};
let offest = sql.offset as usize;
let offset = sql.offset as usize;
let (start_time, end_time) = sql.time_range.unwrap();
// get full text search fields
@ -105,7 +105,7 @@ pub fn generate_optimizer_rules(sql: &Sql) -> Vec<Arc<dyn OptimizerRule + Send +
// *********** custom rules ***********
rules.push(Arc::new(RewriteHistogram::new(start_time, end_time)));
if let Some(limit) = limit {
rules.push(Arc::new(AddSortAndLimitRule::new(limit, offest)));
rules.push(Arc::new(AddSortAndLimitRule::new(limit, offset)));
};
rules.push(Arc::new(AddTimestampRule::new(start_time, end_time)));
// ************************************

View File

@ -73,7 +73,7 @@ pub fn clear(trace_id: &str) {
drop(w);
// Remove all segment data for the given trace_id
// here we can resue the keys, because they are the same
// here we can reuse the keys, because they are the same
let mut w = SEGMENTS.write();
for key in keys.iter() {
w.remove(key);

View File

@ -288,7 +288,7 @@ mod tests {
.otherwise(lit(false))
.expect("valid case expr"))
));
// static expression not relvant in this context but we
// static expression not relevant in this context but we
// test it as an edge case anyway in case we want to generalize
// this helper function
assert!(expr_applicable_for_cols(&[], &lit(true)));

View File

@ -584,7 +584,7 @@ async fn filter_file_list_by_inverted_index(
/// Fetches the file from cache if it exists, otherwise fetch from storage
async fn fetch_file(file_name: &str) -> anyhow::Result<Vec<u8>> {
// first get from meory cache
// first get from memory cache
if file_data::memory::exist(file_name).await {
return file_data::memory::get(file_name, None)
.await

View File

@ -163,7 +163,7 @@ pub async fn search(
user_id.clone(),
Some((query.start_time, query.end_time)),
in_req.search_type.map(|v| v.to_string()),
in_req.index_type.optinal(),
in_req.index_type.optional(),
);
let span = tracing::span::Span::current();
@ -892,7 +892,7 @@ fn generate_search_schema_diff(
schema: &Schema,
schema_latest_map: &HashMap<&String, &Arc<Field>>,
) -> Result<HashMap<String, DataType>, Error> {
// cacluate the diff between latest schema and group schema
// calculate the diff between latest schema and group schema
let mut diff_fields = HashMap::new();
for field in schema.fields().iter() {

View File

@ -309,7 +309,7 @@ fn generate_schema_fields(
}
/// visit a sql to get all columns
/// TODO: handle subquery without (table.field_name) perfix
/// TODO: handle subquery without (table.field_name) prefix
struct ColumnVisitor<'a> {
columns: HashMap<String, HashSet<String>>,
columns_alias: HashSet<(String, String)>,

View File

@ -325,7 +325,7 @@ pub async fn update_user(
}
#[cfg(not(feature = "enterprise"))]
log::debug!("Role chnaged from {:?} to {:?}", old_role, new_role);
log::debug!("Role changed from {:?} to {:?}", old_role, new_role);
Ok(HttpResponse::Ok().json(MetaHttpResponse::message(
http::StatusCode::OK.into(),
"User updated successfully".to_string(),

View File

@ -117,11 +117,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -403,11 +403,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -689,11 +689,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -975,11 +975,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -1261,11 +1261,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -1547,11 +1547,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -1833,11 +1833,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -2119,11 +2119,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -2405,11 +2405,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -2691,11 +2691,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -2977,11 +2977,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -3263,11 +3263,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -3549,11 +3549,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -3835,11 +3835,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
@ -4121,11 +4121,11 @@
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "1KM Time Trial", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Bronze", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "FLAMENG, L\u00e9on", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Gold", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "MASSON, Paul", "Country": "FRA", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Gold", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Indivual", "Medal": "Silver", "Season": "summer"}
{"Year": 1896, "City": "Athens", "Sport": "Cycling", "Discipline": "Cycling Track", "Athlete": "NIKOLOPOULOS, Stamatios", "Country": "GRE", "Gender": "Men", "Event": "Sprint Individual", "Medal": "Silver", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }
{"Year": 1896, "City": "Athens", "Sport": "Fencing", "Discipline": "Fencing", "Athlete": "PIERRAKOS-MAVROMICHALIS, Perikles", "Country": "GRE", "Gender": "Men", "Event": "Foil Individual", "Medal": "Bronze", "Season": "summer"}
{ "index" : { "_index" : "olympics_schema" } }

View File

@ -94,7 +94,7 @@ mod tests {
#[test]
async fn e2e_test() {
// make sure data dir is deleted before we run integ tests
// make sure data dir is deleted before we run integration tests
fs::remove_dir_all("./data")
.unwrap_or_else(|e| log::info!("Error deleting local dir: {}", e));
@ -1014,7 +1014,7 @@ mod tests {
async fn e2e_post_metrics() {
let auth = setup();
let loc_lable: Vec<prometheus_rpc::Label> = vec![
let loc_label: Vec<prometheus_rpc::Label> = vec![
prometheus_rpc::Label {
name: "__name__".to_string(),
value: "grafana_api_dashboard_save_milliseconds_count".to_string(),
@ -1054,7 +1054,7 @@ mod tests {
let loc_hist: Vec<prometheus_rpc::Histogram> = vec![];
let ts = prometheus_rpc::TimeSeries {
labels: loc_lable,
labels: loc_label,
samples: loc_samples,
exemplars: loc_exemp,
histograms: loc_hist,