Sha256: 817c4d1a5ae0e3dc642c415acae4f0c0e723d7f8334cafc132667be51e7e0ae8
Contents?: true
Size: 459 Bytes
Versions: 9
Compression:
Stored size: 459 Bytes
Contents
# frozen_string_literal: true StatsLite.configure do |s, h| s.password "1234" s.port 3000 s.data -> (data) do data[:ruby_current_time] = Time.now data[:linux_time] = h.command("date") data[:slow_command] = h.fetch :slow_command, -> { sleep 1 "SLOW1233" }, expires_in: 5 end s.app do |sinatra| sinatra.get("/another_route") do content_type :json { cpus: h.command("nproc") }.to_json end end end
Version data entries
9 entries across 9 versions & 1 rubygems