Skip to content

Commit

Permalink
Debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Sep 10, 2024
1 parent 4423aa4 commit 1ab6a8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion extract_goaccess_metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ metrics(){
python3 goaccess_metric_parser.py -f "${OUTPUTS_PATH}/${filename}_full.json" -g 0
else
python3 goaccess_metric_parser.py -f "${OUTPUTS_PATH}/${filename}_full.json" -g 0 -u

fi

status_codes=('200' '204' '404' '500')
init="t"

Expand Down
5 changes: 4 additions & 1 deletion goaccess_metric_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
> Output format: {continent, country, total_visits, unique_visits, start_date, end_date}
"""
def parse_geolocation_info(write_type):

with open(f'{OUTPUT_PATH}/geolocation_metrics.csv', write_type, newline='') as gfile:
writer = csv.writer(gfile)
fields = ["continent", "country", "total_visits", "unique_visits", "start_metric_date", "end_metric_date"]
Expand Down Expand Up @@ -116,8 +115,12 @@ def parse_requests_info(status_code, write_type):
wr="a"

if args.general:
print(">>> ", args.file_path)
print(">>> ", wr)
parse_geolocation_info(wr)
if args.partial:
print(">>> ", args.file_path)
print(">>> ", wr)
parse_requests_info(args.status_code, wr)


Expand Down

0 comments on commit 1ab6a8d

Please sign in to comment.