mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 22:26:22 +00:00
18 lines
487 B
Ruby
18 lines
487 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Estadísticas del sitio
|
|
class StatsController < ApplicationController
|
|
include Pundit
|
|
before_action :authenticate_usuarie!
|
|
|
|
def index
|
|
@site = find_site
|
|
authorize SiteStat.new(@site)
|
|
|
|
# Solo queremos el promedio de tiempo de compilación, no de
|
|
# instalación de dependencias.
|
|
stats = @site.build_stats.jekyll
|
|
@build_avg = stats.average(:seconds).to_f.round(2)
|
|
@build_max = stats.maximum(:seconds).to_f.round(2)
|
|
end
|
|
end
|