Class: Presto::Client::StatementStats

Inherits:
Object
  • Object
show all
Defined in:
lib/presto/client/models.rb

Overview

class StageStats

attr_reader :stage_id
attr_reader :state
attr_reader :done
attr_reader :nodes
attr_reader :total_splits
attr_reader :queued_splits
attr_reader :running_splits
attr_reader :completed_splits
attr_reader :user_time_millis
attr_reader :cpu_time_millis
attr_reader :wall_time_millis
attr_reader :processed_rows
attr_reader :processed_bytes
attr_reader :sub_stages

def initialize(options={})
  @stage_id = options[:stage_id]
  @state = options[:state]
  @done = options[:done]
  @nodes = options[:nodes]
  @total_splits = options[:total_splits]
  @queued_splits = options[:queued_splits]
  @running_splits = options[:running_splits]
  @completed_splits = options[:completed_splits]
  @user_time_millis = options[:user_time_millis]
  @cpu_time_millis = options[:cpu_time_millis]
  @wall_time_millis = options[:wall_time_millis]
  @processed_rows = options[:processed_rows]
  @processed_bytes = options[:processed_bytes]
  @sub_stages = options[:sub_stages]
end

def self.decode_hash(hash)
  new(
    stage_id: hash["stageId"],
    state: hash["state"],
    done: hash["done"],
    nodes: hash["nodes"],
    total_splits: hash["totalSplits"],
    queued_splits: hash["queuedSplits"],
    running_splits: hash["runningSplits"],
    completed_splits: hash["completedSplits"],
    user_time_millis: hash["userTimeMillis"],
    cpu_time_millis: hash["cpuTimeMillis"],
    wall_time_millis: hash["wallTimeMillis"],
    processed_rows: hash["processedRows"],
    processed_bytes: hash["processedBytes"],
    sub_stages: hash["subStages"].map {|h| StageStats.decode_hash(h) },
  )
end

end

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ StatementStats

attr_reader :root_stage



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/presto/client/models.rb', line 124

def initialize(options={})
  @state = state
  @scheduled = scheduled
  @nodes = nodes
  @total_splits = total_splits
  @queued_splits = queued_splits
  @running_splits = running_splits
  @completed_splits = completed_splits
  @user_time_millis = user_time_millis
  @cpu_time_millis = cpu_time_millis
  @wall_time_millis = wall_time_millis
  @processed_rows = processed_rows
  @processed_bytes = processed_bytes
  #@root_stage = root_stage
end

Instance Attribute Details

#completed_splitsObject (readonly)

Returns the value of attribute completed_splits.



116
117
118
# File 'lib/presto/client/models.rb', line 116

def completed_splits
  @completed_splits
end

#cpu_time_millisObject (readonly)

Returns the value of attribute cpu_time_millis.



118
119
120
# File 'lib/presto/client/models.rb', line 118

def cpu_time_millis
  @cpu_time_millis
end

#nodesObject (readonly)

Returns the value of attribute nodes.



112
113
114
# File 'lib/presto/client/models.rb', line 112

def nodes
  @nodes
end

#processed_bytesObject (readonly)

Returns the value of attribute processed_bytes.



121
122
123
# File 'lib/presto/client/models.rb', line 121

def processed_bytes
  @processed_bytes
end

#processed_rowsObject (readonly)

Returns the value of attribute processed_rows.



120
121
122
# File 'lib/presto/client/models.rb', line 120

def processed_rows
  @processed_rows
end

#queued_splitsObject (readonly)

Returns the value of attribute queued_splits.



114
115
116
# File 'lib/presto/client/models.rb', line 114

def queued_splits
  @queued_splits
end

#running_splitsObject (readonly)

Returns the value of attribute running_splits.



115
116
117
# File 'lib/presto/client/models.rb', line 115

def running_splits
  @running_splits
end

#scheduledObject (readonly)

Returns the value of attribute scheduled.



111
112
113
# File 'lib/presto/client/models.rb', line 111

def scheduled
  @scheduled
end

#stateObject (readonly)

Returns the value of attribute state.



110
111
112
# File 'lib/presto/client/models.rb', line 110

def state
  @state
end

#total_splitsObject (readonly)

Returns the value of attribute total_splits.



113
114
115
# File 'lib/presto/client/models.rb', line 113

def total_splits
  @total_splits
end

#user_time_millisObject (readonly)

Returns the value of attribute user_time_millis.



117
118
119
# File 'lib/presto/client/models.rb', line 117

def user_time_millis
  @user_time_millis
end

#wall_time_millisObject (readonly)

Returns the value of attribute wall_time_millis.



119
120
121
# File 'lib/presto/client/models.rb', line 119

def wall_time_millis
  @wall_time_millis
end

Class Method Details

.decode_hash(hash) ⇒ Object



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/presto/client/models.rb', line 140

def self.decode_hash(hash)
  new(
    state: hash["state"],
    scheduled: hash["scheduled"],
    nodes: hash["nodes"],
    total_splits: hash["totalSplits"],
    queued_splits: hash["queuedSplits"],
    running_splits: hash["runningSplits"],
    completed_splits: hash["completedSplits"],
    user_time_millis: hash["userTimeMillis"],
    cpu_time_millis: hash["cpuTimeMillis"],
    wall_time_millis: hash["wallTimeMillis"],
    processed_rows: hash["processedRows"],
    processed_bytes: hash["processedBytes"],
    #root_stage: StageStats.decode_hash(hash["rootStage"]),
  )
end