Skip to content

Commit

Permalink
2022.12.09:
Browse files Browse the repository at this point in the history
* fixed: bash/github/accum-stats.sh: 14d `count` and `uniques` decrement by the last day
  • Loading branch information
andry81 committed Dec 9, 2022
1 parent 9eedc89 commit 6150602
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
16 changes: 13 additions & 3 deletions bash/github/accum-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ jq_fix_null \

gh_print_notice_and_write_to_changelog_text_bullet_ln "last 14d: unq all: $uniques $count"

IFS=$'\n' read -r -d '' stats_accum_timestamp_prev count_outdated_prev uniques_outdated_prev count_prev uniques_prev <<< "$(jq -c -r ".timestamp,.count_outdated,.uniques_outdated,.count,.uniques" $stats_accum_json)"
IFS=$'\n' read -r -d '' stats_accum_timestamp_prev count_outdated_prev uniques_outdated_prev count_prev uniques_prev <<< \
"$(jq -c -r ".timestamp,.count_outdated,.uniques_outdated,.count,.uniques" $stats_accum_json)"
# CAUTION:
# Prevent of invalid values spread if upstream user didn't properly commit completely correct json file or didn't commit at all.
Expand Down Expand Up @@ -355,8 +356,17 @@ count_next=0
uniques_next=0
for (( i=0; i < ${#stats_timestamps[@]}; i++ )); do
(( count_next += ${stats_counts[i]} ))
(( uniques_next += ${stats_uniques[i]} ))
# NOTE:
# Use the maximum only for the edge value, even if multiple values is outdated, because only
# edge values has a significant interpolation distortion.
#
if (( i )); then
(( count_next += ${stats_counts[i]} ))
(( uniques_next += ${stats_uniques[i]} ))
else
(( count_next += ${stats_count_max[i]} ))
(( uniques_next += ${stats_uniques_max[i]} ))
fi
done
(( count_next += count_outdated_next ))
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2022.12.09:
* fixed: bash/github/accum-stats.sh: 14d `count` and `uniques` decrement by the last day

2022.11.11:
* changed: README.md: readme update

Expand Down
3 changes: 3 additions & 0 deletions userlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
> :warning: to find all changes use [changelog.txt](https://github.com/andry81-devops/gh-workflow/blob/master/changelog.txt) file in a directory
## 2022.12.09:
* fixed: bash/github/accum-stats.sh: 14d `count` and `uniques` decrement by the last day

## 2022.10.12:
* new: bash/github/is-flag-true-in-flags-expr-string.sh: added `gh_is_flag_true_in_flags_expr_string` function to evaluate flag expression strings

Expand Down

0 comments on commit 6150602

Please sign in to comment.