module Presto::Client::ModelVersions::V0_178::DistributionSnapshot

io.airlift.stats.Distribution.DistributionSnapshot

Public Class Methods

decode(hash) click to toggle source
# File lib/presto/client/model_versions/0.178.rb, line 132
def decode(hash)
  unless hash.is_a?(Hash)
    raise TypeError, "Can't convert #{hash.class} to Hash"
  end
  obj = allocate
  obj.send(:initialize_struct,
    hash["maxError"],
    hash["count"],
    hash["total"],
    hash["p01"],
    hash["p05"],
    hash["p10"],
    hash["p25"],
    hash["p50"],
    hash["p75"],
    hash["p90"],
    hash["p95"],
    hash["p99"],
    hash["min"],
    hash["max"],
  )
  obj
end