Skip to content

[FEATURE] Analytics first version#44

Merged
azeveco merged 12 commits intodevfrom
feature-analytics
May 26, 2025
Merged

[FEATURE] Analytics first version#44
azeveco merged 12 commits intodevfrom
feature-analytics

Conversation

@cavalcanteyury
Copy link
Collaborator

Context

A first version for tracking Analytics for a single feature, passing on the identifier as params.
This was discussed here in the previous issue create

Discussions in the issue got obsolete, as we decided to move further with a first version tracking a specific feature passing its identifier as a parameter.

See more info on analytics usage below in Resolution

Resolution

  • Added the Togglefy method analytics_for, that calls our specific Analytics class to track a feature
# in lib/togglefy.rb
...
Togglefy.analytics_for(:arachnid_super_power)
...

Analytics class basically reads the identifier passed as parameter, initializes with the accordingly feature, and tries to track it.
The found system found Assignables will be arranged into an Array of Hashes.

Each Hash represent the found Assignable and its tracked data, something like that:

[{assignable: "User",
  total: 4,
  enabled_count: 2,
  disabled_count: 2,
  percentage_enabled: "50.0%",
  percentage_disabled: "50.0%",
  first_created: 2025-04-21 01:43:28.266664000 UTC +00:00,
  last_created: 2025-05-21 19:18:37.772172000 UTC +00:00,
  past7: 1,
  past14: 1,
  past30: 2}]

Impacted processes/locations

  • Changed rails_helper.rb to use Rails native time travel

References

Issue 21: Feature statistics/analytics

@cavalcanteyury cavalcanteyury requested a review from azeveco May 24, 2025 20:40
@cavalcanteyury cavalcanteyury self-assigned this May 24, 2025
@cavalcanteyury cavalcanteyury added the enhancement New feature or request label May 24, 2025
@cavalcanteyury cavalcanteyury requested a review from azeveco May 26, 2025 00:09
@cavalcanteyury cavalcanteyury changed the base branch from main to dev May 26, 2025 12:27
Copy link
Owner

@azeveco azeveco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@azeveco azeveco merged commit dbce893 into dev May 26, 2025
2 checks passed
@azeveco azeveco deleted the feature-analytics branch May 26, 2025 14:30
@azeveco azeveco linked an issue May 27, 2025 that may be closed by this pull request
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Statistics / Analytics

2 participants