lib/rhoconnect/api/system/stats.rb in rhoconnect-3.4.5 vs lib/rhoconnect/api/system/stats.rb in rhoconnect-4.0.0.beta.10
- old
+ new
@@ -1,22 +1,22 @@
-Server.api4 :stats, :get, "/rc/#{Rhoconnect::API_VERSION}/system/stats", \
- true, {:verb => :post, :url => ['/api/stats', '/api/admin/stats']} 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
\ No newline at end of file
+# Server.api4 :stats, :get, "/rc/#{Rhoconnect::API_VERSION}/system/stats", \
+# true, {:verb => :post, :url => ['/api/stats', '/api/admin/stats']} 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