Sha256: ded5fc53ef38ad8b08a21964d37e4f6e41b8e860c3336fa932560de68e799aef
Contents?: true
Size: 647 Bytes
Versions: 22
Compression:
Stored size: 647 Bytes
Contents
Server.api :stats, :admin do |params,user| if Rhoconnect.stats == true names = params[:names] if names Rhoconnect::Stats::Record.keys(names).to_json else metric = params[:metric] rtype = Rhoconnect::Stats::Record.rtype(metric) if rtype == 'zset' # returns [] if no results Rhoconnect::Stats::Record.range(metric,params[:start],params[:finish]).to_json elsif rtype == 'string' Rhoconnect::Stats::Record.get_value(metric) || '' else raise ApiException.new(404, "Unknown metric") end end else raise ApiException.new(500, "Stats not enabled") end end
Version data entries
22 entries across 22 versions & 1 rubygems