<commit_before>require 'thor'
require 'terminal-table'

# Example:
# init_values = {:ttl => 3600, :raw_data_ttl => 600, :interval => 10, :reduce_delay => 3}
# max = PulseMeter::Sensor::Timelined::Max.new(:max, init_values)
# median = PulseMeter::Sensor::Timelined::Median.new(:median, init_values)

module Cmd
  class All < Thor
    no_tasks do
      def init_redis!
        redis = Redis.new :host => options[:host], :port => options[:port], :db => options[:db]
        PulseMeter.redis = redis
      end

      def all_sensors
        PulseMeter::Sensor::Timeline.list_objects
      end

      def all_sensors_table(title = '')
        table = Terminal::Table.new
        table << ["Name", "Class", "ttl", "raw data ttl", "interval", "reduce delay"]
        table << :separator
        all_sensors.each {|s| table << [s.name, s.class, s.ttl, s.raw_data_ttl, s.interval, s.reduce_delay]}
        table
      end
    end
<commit_msg>missing table title added<commit_after>require 'thor'
require 'terminal-table'

# Example:
# init_values = {:ttl => 3600, :raw_data_ttl => 600, :interval => 10, :reduce_delay => 3}
# max = PulseMeter::Sensor::Timelined::Max.new(:max, init_values)
# median = PulseMeter::Sensor::Timelined::Median.new(:median, init_values)

module Cmd
  class All < Thor
    no_tasks do
      def init_redis!
        redis = Redis.new :host => options[:host], :port => options[:port], :db => options[:db]
        PulseMeter.redis = redis
      end

      def all_sensors
        PulseMeter::Sensor::Timeline.list_objects
      end

      def all_sensors_table(title = '')
        table = Terminal::Table.new :title => title
        table << ["Name", "Class", "ttl", "raw data ttl", "interval", "reduce delay"]
        table << :separator
        all_sensors.each {|s| table << [s.name, s.class, s.ttl, s.raw_data_ttl, s.interval, s.reduce_delay]}
        table
      end
    end

{'fraction_non_alphanumeric': 0.14836325237592396, 'fraction_numerical': 0.010559662090813094, 'mean_word_length': 3.183222958057395, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3157256', 'n_tokens_mistral': 676, 'n_tokens_neox': 641, 'n_words': 149}