Skip to content

Commit

Permalink
ADD half year visual
Browse files Browse the repository at this point in the history
  • Loading branch information
wabscale committed Feb 11, 2022
1 parent 2d740c6 commit 4f1e462
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/anubis/views/public/visuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ def public_visuals_usage_active():
return make_png_response(blob)


@visuals_.route("/usage/active-half-year")
def public_visuals_usage_active_half_year():
# Get the png blob of the usage graph.
# The get_usage_plot is itself a cached function.
blob = get_usage_plot_active(days=180, step=1)

return make_png_response(blob)


@visuals_.route("/usage/active-month")
def public_visuals_usage_active_month():
# Get the png blob of the usage graph.
Expand Down
3 changes: 3 additions & 0 deletions api/jobs/visuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def main():
# Generate plot for active in last month
get_usage_plot_active(days=90, step=7)

# Generate plot for active in last half year
get_usage_plot_active(days=180, step=1)


if __name__ == "__main__":
print(f"Running visuals job - {datetime.now()}")
Expand Down

0 comments on commit 4f1e462

Please sign in to comment.