tally 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/jobs/tally/archiver_job.rb +18 -0
- data/app/jobs/tally/sweeper_job.rb +11 -0
- data/lib/tally/version.rb +1 -1
- data/lib/tasks/tally_tasks.rake +7 -7
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1c7ca6dc7f3a11bd24936a64edb11c8b18a21ef0788b09598a45a5eb746237d
|
4
|
+
data.tar.gz: 112af234512f74e6e284ed8f210084c586bc7eb3b36a7f1c1c12a9d21f373403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61eb9b0fc574bfcbc23585cdef758bde1b9f9e57afcff608b7b99131ce6b847dedd051d7d358fcc22287547a473da4f75ad3b1e4ece5951ad23dcbc58e253e7e
|
7
|
+
data.tar.gz: 455f9248a7f3427ef635209b806e7b69a17dace683821621b47bcd0608f3efa9d4257575c86fcb9bfad2517d768a7cd47b80c0f6312b25fe1c156f54088130f5
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Tally
|
2
2
|
|
3
|
-
[](https://github.com/jdtornow/tally/actions/workflows/tests.yml)
|
4
4
|
|
5
5
|
Tally is a simple Rails engine for capturing counts of various activities around an app. These counts are quickly captured in Redis then are archived periodically within the app's default relational database.
|
6
6
|
|
@@ -12,8 +12,8 @@ _[Read more about Tally in my blog post introducing it ...](https://johntornow.c
|
|
12
12
|
|
13
13
|
## Requirements
|
14
14
|
|
15
|
-
* Ruby 3.
|
16
|
-
* Rails
|
15
|
+
* Ruby 3.2+
|
16
|
+
* Rails 7+
|
17
17
|
* Redis 4+
|
18
18
|
|
19
19
|
## Installation
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Tally
|
4
|
+
class ArchiverJob < ApplicationJob
|
5
|
+
|
6
|
+
def perform(day = "today")
|
7
|
+
case day.to_s
|
8
|
+
when /^\d{4}-\d{2}-\d{2}$/
|
9
|
+
Tally::Archiver.archive! day: Date.parse(day)
|
10
|
+
when "yesterday"
|
11
|
+
Tally::Archiver.archive! day: 1.day.ago.to_date
|
12
|
+
else
|
13
|
+
Tally::Archiver.archive!
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/tally/version.rb
CHANGED
data/lib/tasks/tally_tasks.rake
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
namespace :tally do
|
2
2
|
desc "Sweep all outdated keys from the data store"
|
3
|
-
task :
|
4
|
-
Tally::
|
3
|
+
task sweep: :environment do
|
4
|
+
Tally::SweeperJob.perform_now
|
5
5
|
|
6
6
|
Rake::Task["tally:wait_for_async_queue"].execute
|
7
7
|
end
|
8
8
|
|
9
9
|
desc "Archive today's temporary keys into record entries in the database"
|
10
|
-
task :
|
11
|
-
Tally::
|
10
|
+
task archive: :environment do
|
11
|
+
Tally::ArchiverJob.perform_now
|
12
12
|
|
13
13
|
Rake::Task["tally:wait_for_async_queue"].execute
|
14
14
|
end
|
15
15
|
|
16
16
|
desc "Archive yesterday's temporary keys into record entries in the database"
|
17
|
-
task "archive:yesterday"
|
18
|
-
Tally::
|
17
|
+
task "archive:yesterday": :environment do
|
18
|
+
Tally::ArchiverJob.perform_now("yesterday")
|
19
19
|
|
20
20
|
Rake::Task["tally:wait_for_async_queue"].execute
|
21
21
|
end
|
@@ -24,7 +24,7 @@ namespace :tally do
|
|
24
24
|
#
|
25
25
|
# This is not needed for other adapters besides async, but since it is the
|
26
26
|
# Rails default, we're accounting for it here.
|
27
|
-
task :
|
27
|
+
task wait_for_async_queue: :environment do
|
28
28
|
if Rails.application.config.active_job.queue_adapter == :async
|
29
29
|
ActiveJob::Base.queue_adapter.shutdown(wait: true)
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tally
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John D. Tornow
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-21 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rails
|
@@ -19,7 +18,7 @@ dependencies:
|
|
19
18
|
version: 5.2.0
|
20
19
|
- - "<"
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
21
|
+
version: '9'
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +28,7 @@ dependencies:
|
|
29
28
|
version: 5.2.0
|
30
29
|
- - "<"
|
31
30
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
31
|
+
version: '9'
|
33
32
|
- !ruby/object:Gem::Dependency
|
34
33
|
name: redis
|
35
34
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,7 +190,9 @@ files:
|
|
191
190
|
- app/helpers/tally/application_helper.rb
|
192
191
|
- app/helpers/tally/increment_helper.rb
|
193
192
|
- app/jobs/tally/application_job.rb
|
193
|
+
- app/jobs/tally/archiver_job.rb
|
194
194
|
- app/jobs/tally/calculator_runner_job.rb
|
195
|
+
- app/jobs/tally/sweeper_job.rb
|
195
196
|
- app/models/tally/application_record.rb
|
196
197
|
- app/models/tally/record.rb
|
197
198
|
- app/presenters/tally/record_presenter.rb
|
@@ -222,7 +223,6 @@ metadata:
|
|
222
223
|
homepage_uri: https://github.com/jdtornow/tally
|
223
224
|
source_code_uri: https://github.com/jdtornow/tally
|
224
225
|
wiki_uri: https://github.com/jdtornow/tally/wiki
|
225
|
-
post_install_message:
|
226
226
|
rdoc_options: []
|
227
227
|
require_paths:
|
228
228
|
- lib
|
@@ -237,8 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
237
|
- !ruby/object:Gem::Version
|
238
238
|
version: 1.8.11
|
239
239
|
requirements: []
|
240
|
-
rubygems_version: 3.3
|
241
|
-
signing_key:
|
240
|
+
rubygems_version: 3.6.3
|
242
241
|
specification_version: 4
|
243
242
|
summary: Stats collection and reporting
|
244
243
|
test_files: []
|