Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record and report rules usage statistics #47

Open
luispfgarces opened this issue Nov 27, 2021 · 0 comments
Open

Record and report rules usage statistics #47

luispfgarces opened this issue Nov 27, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed low priority Low priority issue

Comments

@luispfgarces
Copy link
Contributor

luispfgarces commented Nov 27, 2021

Purpose

Record usage of each rule and generate statistics, to help users assess the impact of specific rules on their usage scenarios.

Main functionalities

  • Record rules evaluation counters - per rule.
  • Record rules match counters - per rule, separate counters for match one and match many.
  • Generate parameterized statistics in tabular-like format.

Assume default time bucket for counters as 1 hour - but make it configurable. Make sure each time bucket records its' start date and time.

Proposal

Assume the record of evaluation and match counters to be created/updated on each evaluation done to RulesEngine. A internal Rules.Framework component for acting as listener should be designed and implemented to achieve this - design open for suggestions, leaving this without proposal for now.

Create a new method on RulesEngine to generate statistics in a tabular-like format - Statistics GenerateRulesUsageStatistics(GenerateRulesUsageStatisticsArgs generateStatisticsArgs):

  • Receive as parameter new value object GenerateRulesUsageStatisticsArgs:
    • Allow defining a time interval - DateBegin and DateEnd
      • Should we make time interval mandatory? If not mandatory, should we have a hard default defined (not configurable)?
      • Should we limit time interval range?
    • Allow filtering by content type - ContentType
    • Allow filtering for rule names set - RuleNames - an array of strings
    • Must define scope of statistics generation - Scope - an enum parameter:
      • Evaluation - generate statistics for rules evaluation
      • MatchOne - generate statistics for match one result rules
      • MatchMany - generate statistics for match many result rules
      • Match - generate statistics for all match types result rules
  • Return result in new object Statistics:
    • Must have a collection of StatisticsBucket:
      • Each StatisticsBucket includes:
        • Name to describe, in this case, which rule name the bucket refers to
        • A Timestamp to describe in time to when the bucket is reporting
        • And also a numeric Value to refer the bucket value - in this case it will be an integer, but it would be appropriate to use a decimal or a floating point type for future usage on other statistics use cases.
    • Should we group StatisticsBucket per name or per timestamp?
  • Must have a time interval - DateBegin and DateEnd

NOTE: proposal is open to debate and actual implementation plan is to be added later here.

@luispfgarces luispfgarces added enhancement New feature or request help wanted Extra attention is needed labels Nov 27, 2021
@Daniel-C-Dias Daniel-C-Dias added the low priority Low priority issue label May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed low priority Low priority issue
Projects
None yet
Development

No branches or pull requests

2 participants