class PrivateParlorXT::SQLiteStatistics
- PrivateParlorXT::SQLiteStatistics
- PrivateParlorXT::Statistics
- Reference
- Object
Overview
An implementation of Statistics
using the Database
for storing message data
Defined in:
private-parlor-xt/statistics/sqlite_statistics.crConstructors
-
.new(connection : DB::Database)
Generally this should use the same connection that was used for the database
Instance Method Summary
-
#ensure_schema : Nil
Ensures that there is a 'message_stats' table in the database
-
#ensure_start_date : Nil
Ensures that there is a date value for the 'start_date' key in the 'system_config' table
-
#increment_downvotes : Nil
Increment the number of downvotes given
-
#increment_messages(type : Messages) : Nil
Increment the message count according to the given type and increment the total number of messages in general
-
#increment_unoriginal_media : Nil
Increment the number of unoriginal media messages encountered
-
#increment_unoriginal_text : Nil
Increment the number of unoriginal text messages encountered
-
#increment_upvotes : Nil
Increment the number of upvotes given
-
#karma_counts : Hash(Karma, Int32)
Returns a hash of
Karma
to `Int32 , containing the total number of karma given or lost, and daily, weekly, and monthly totals -
#karma_level_count(start_value : Int32, end_value : Int32) : Int32
Returns an
Int32
total of users whose karma lie between start_value and end_value -
#message_counts : Hash(Messages, Int32)
Returns a hash of
Messages
toInt32
, containing the total number of message for each type and daily, weekly, and monthly totals -
#robot9000_counts : Hash(Robot9000, Int32)
Returns a hash of
Robot9000
toInt32
, containing the total number of unique and unoriginal messages for texts and media types -
#start_date : String
Returns a
String
containing the date at which the statistics module was initialized -
#user_counts : Hash(Users, Int32)
Returns a hash of
Users
toInt32
, containing the total number of each kind of user and daily, weekly, and monthly totals
Instance methods inherited from class PrivateParlorXT::Statistics
config_screen(services : Services) : String
config_screen,
configuration_details(services : Services) : Hash(BotInfo, String)
configuration_details,
full_users_screen(services : Services) : String
full_users_screen,
increment_downvotes : Nil
increment_downvotes,
increment_messages(type : Messages) : Nil
increment_messages,
increment_unoriginal_media : Nil
increment_unoriginal_media,
increment_unoriginal_text : Nil
increment_unoriginal_text,
increment_upvotes : Nil
increment_upvotes,
karma_counts : Hash(Karma, Int32)
karma_counts,
karma_level_count(start_value : Int32, end_value : Int32) : Int32
karma_level_count,
karma_levels_screen(services : Services) : String
karma_levels_screen,
karma_screen(services : Services) : String
karma_screen,
keyboard_markup(next_screen : StatScreens, services : Services) : Tourmaline::InlineKeyboardMarkup
keyboard_markup,
message_counts : Hash(Messages, Int32)
message_counts,
messages_screen(services : Services) : String
messages_screen,
percent_change(initial : Int32, final : Int32) : Float64
percent_change,
robot9000_counts : Hash(Robot9000, Int32)
robot9000_counts,
robot9000_screen(services : Services) : String
robot9000_screen,
start_date : String
start_date,
start_time : Time
start_time,
statistic_screen(next_screen : StatScreens, services : Services) : String
statistic_screen,
uptime : Time::Span
uptime,
user_counts : Hash(Users, Int32)
user_counts,
users_screen(services : Services) : String
users_screen
Constructor Detail
Generally this should use the same connection that was used for the database
Instance Method Detail
Ensures that there is a date value for the 'start_date' key in the 'system_config' table
Increment the message count according to the given type and increment the total number of messages in general
Increment the number of unoriginal media messages encountered
Returns a hash of Karma
to `Int32 , containing the total number of karma given or lost, and daily, weekly, and monthly totals
Returns an Int32
total of users whose karma lie between start_value and end_value
Returns a hash of Messages
to Int32
, containing the total number of message for each type and daily, weekly, and monthly totals
Returns a hash of Robot9000
to Int32
, containing the total number of unique and unoriginal messages for texts and media types
Returns a String
containing the date at which the statistics module was initialized
Returns a hash of Users
to Int32
, containing the total number of each kind of user and daily, weekly, and monthly totals