class School::Metrics

Overview

Rule engine metrics accumulator.

Defined in:

school/domain/metrics.cr

Constant Summary

INSTANCE = new

Class Method Summary

Instance Method Summary

Class Method Detail

def self.conditions #

[View source]
def self.count_condition #

[View source]
def self.count_operation #

[View source]
def self.count_rule #

[View source]
def self.count_run #

[View source]
def self.instance #

Returns the Metrics singleton instance.


[View source]
def self.metrics #

[View source]
def self.operations #

[View source]
def self.reset #

[View source]
def self.rules #

[View source]
def self.runs #

[View source]
def self.start #

[View source]

Instance Method Detail

def conditions : Int32 #

[View source]
def count_condition #

Increments conditions.


[View source]
def count_operation #

Increments operations.


[View source]
def count_rule #

Increments rules.


[View source]
def count_run #

Increments runs.


[View source]
def metrics(*, now = Time.utc) #

Returns the metrics.

A parameter for the current time is provided for testing purposes.


[View source]
def operations : Int32 #

[View source]
def reset(*, runs : Int32 = 0, rules : Int32 = 0, conditions : Int32 = 0, operations : Int32 = 0, start : Time = Time.utc) #

Resets internal state.

Parameters for explicitly setting internal state are provided for testing purposes.


[View source]
def rules : Int32 #

[View source]
def runs : Int32 #

[View source]
def runtime(*, now = Time.utc) #

Returns the runtime.

A parameter for the current time is provided for testing purposes.


[View source]
def start : Time #

[View source]