2508: docs: Readability improvements in `download-latest.sh` and `src/analytics/.rs` r=Kerollmops a=ryanrussell

# Pull Request

## What does this PR do?
Improves readability in `download-latest.sh` and in the `src/analytics/.rs` files

## PR checklist
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: Ryan Russell <git@ryanrussell.org>
This commit is contained in:
bors[bot] 2022-06-13 08:18:17 +00:00 committed by GitHub
commit 0f6e650ba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -67,8 +67,8 @@ semverLT() {
return 1 return 1
} }
# Get a token from https://github.com/settings/tokens to increasae rate limit (from 60 to 5000), make sure the token scope is set to 'public_repo' # Get a token from https://github.com/settings/tokens to increase rate limit (from 60 to 5000), make sure the token scope is set to 'public_repo'
# Create GITHUB_PAT enviroment variable once you aquired the token to start using it # Create GITHUB_PAT environment variable once you acquired the token to start using it
# Returns the tag of the latest stable release (in terms of semver and not of release date) # Returns the tag of the latest stable release (in terms of semver and not of release date)
get_latest() { get_latest() {
temp_file='temp_file' # temp_file needed because the grep would start before the download is over temp_file='temp_file' # temp_file needed because the grep would start before the download is over
@ -89,7 +89,7 @@ get_latest() {
latest='' latest=''
current_tag='' current_tag=''
for release_info in $releases; do for release_info in $releases; do
if [ $i -eq 0 ]; then # Cheking tag_name if [ $i -eq 0 ]; then # Checking tag_name
if echo "$release_info" | grep -q "$GREP_SEMVER_REGEXP"; then # If it's not an alpha or beta release if echo "$release_info" | grep -q "$GREP_SEMVER_REGEXP"; then # If it's not an alpha or beta release
current_tag=$release_info current_tag=$release_info
else else

View File

@ -61,7 +61,7 @@ pub trait Analytics: Sync + Send {
/// The method used to publish most analytics that do not need to be batched every hours /// The method used to publish most analytics that do not need to be batched every hours
fn publish(&self, event_name: String, send: Value, request: Option<&HttpRequest>); fn publish(&self, event_name: String, send: Value, request: Option<&HttpRequest>);
/// This method should be called to aggergate a get search /// This method should be called to aggregate a get search
fn get_search(&self, aggregate: SearchAggregator); fn get_search(&self, aggregate: SearchAggregator);
/// This method should be called to aggregate a post search /// This method should be called to aggregate a post search

View File

@ -495,7 +495,7 @@ impl SearchAggregator {
let percentile_99th = 0.99 * (self.total_succeeded as f64 - 1.) + 1.; let percentile_99th = 0.99 * (self.total_succeeded as f64 - 1.) + 1.;
// we get all the values in a sorted manner // we get all the values in a sorted manner
let time_spent = self.time_spent.into_sorted_vec(); let time_spent = self.time_spent.into_sorted_vec();
// We are only intersted by the slowest value of the 99th fastest results // We are only interested by the slowest value of the 99th fastest results
let time_spent = time_spent.get(percentile_99th as usize); let time_spent = time_spent.get(percentile_99th as usize);
let properties = json!({ let properties = json!({
@ -574,8 +574,8 @@ impl DocumentsAggregator {
let content_type = request let content_type = request
.headers() .headers()
.get(CONTENT_TYPE) .get(CONTENT_TYPE)
.map(|s| s.to_str().unwrap_or("unkown")) .map(|s| s.to_str().unwrap_or("unknown"))
.unwrap_or("unkown") .unwrap_or("unknown")
.to_string(); .to_string();
ret.content_types.insert(content_type); ret.content_types.insert(content_type);
ret.index_creation = index_creation; ret.index_creation = index_creation;