Class: RubynCode::CLI::Commands::Tokens::TokenStats

Inherits:
Data
  • Object
show all
Defined in:
lib/rubyn_code/cli/commands/tokens.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actual_inObject (readonly)

Returns the value of attribute actual_in

Returns:

  • (Object)

    the current value of actual_in



13
14
15
# File 'lib/rubyn_code/cli/commands/tokens.rb', line 13

def actual_in
  @actual_in
end

#actual_outObject (readonly)

Returns the value of attribute actual_out

Returns:

  • (Object)

    the current value of actual_out



13
14
15
# File 'lib/rubyn_code/cli/commands/tokens.rb', line 13

def actual_out
  @actual_out
end

#estimatedObject (readonly)

Returns the value of attribute estimated

Returns:

  • (Object)

    the current value of estimated



13
14
15
# File 'lib/rubyn_code/cli/commands/tokens.rb', line 13

def estimated
  @estimated
end

#message_countObject (readonly)

Returns the value of attribute message_count

Returns:

  • (Object)

    the current value of message_count



13
14
15
# File 'lib/rubyn_code/cli/commands/tokens.rb', line 13

def message_count
  @message_count
end

#thresholdObject (readonly)

Returns the value of attribute threshold

Returns:

  • (Object)

    the current value of threshold



13
14
15
# File 'lib/rubyn_code/cli/commands/tokens.rb', line 13

def threshold
  @threshold
end

Instance Method Details

#pct_thresholdObject



15
# File 'lib/rubyn_code/cli/commands/tokens.rb', line 15

def pct_threshold = ((estimated.to_f / threshold) * 100).round(1)

#pct_windowObject



14
# File 'lib/rubyn_code/cli/commands/tokens.rb', line 14

def pct_window = ((estimated.to_f / CONTEXT_WINDOW) * 100).round(1)

#totalObject



16
# File 'lib/rubyn_code/cli/commands/tokens.rb', line 16

def total = actual_in + actual_out