Class: DecisionAgent::Monitoring::Storage::BaseAdapter
- Inherits:
-
Object
- Object
- DecisionAgent::Monitoring::Storage::BaseAdapter
- Defined in:
- lib/decision_agent/monitoring/storage/base_adapter.rb
Overview
Base adapter interface for metrics storage Subclasses must implement all abstract methods
Direct Known Subclasses
Class Method Summary collapse
-
.available? ⇒ Boolean
Check if adapter is available (dependencies installed).
Instance Method Summary collapse
-
#cleanup(older_than:) ⇒ Integer
Clean up old metrics.
-
#metrics_count ⇒ Hash
Get count of metrics stored.
-
#record_decision(decision, context, confidence: nil, evaluations_count: 0, duration_ms: nil, status: nil) ⇒ void
Record a decision.
-
#record_error(error_type, message: nil, stack_trace: nil, severity: nil, context: {}) ⇒ void
Record an error.
-
#record_evaluation(evaluator_name, score: nil, success: nil, duration_ms: nil, details: {}) ⇒ void
Record an evaluation.
-
#record_performance(operation, duration_ms: nil, status: nil, metadata: {}) ⇒ void
Record a performance metric.
-
#statistics(time_range: 3600) ⇒ Hash
Get statistics for a time range.
-
#time_series(metric_type, bucket_size: 60, time_range: 3600) ⇒ Hash
Get time series data.
Class Method Details
.available? ⇒ Boolean
Check if adapter is available (dependencies installed)
84 85 86 |
# File 'lib/decision_agent/monitoring/storage/base_adapter.rb', line 84 def self.available? raise NotImplementedError, "#{self} must implement .available?" end |
Instance Method Details
#cleanup(older_than:) ⇒ Integer
Clean up old metrics
78 79 80 |
# File 'lib/decision_agent/monitoring/storage/base_adapter.rb', line 78 def cleanup(older_than:) raise NotImplementedError, "#{self.class} must implement #cleanup" end |
#metrics_count ⇒ Hash
Get count of metrics stored
71 72 73 |
# File 'lib/decision_agent/monitoring/storage/base_adapter.rb', line 71 def metrics_count raise NotImplementedError, "#{self.class} must implement #metrics_count" end |
#record_decision(decision, context, confidence: nil, evaluations_count: 0, duration_ms: nil, status: nil) ⇒ void
This method returns an undefined value.
Record a decision
17 18 19 |
# File 'lib/decision_agent/monitoring/storage/base_adapter.rb', line 17 def record_decision(decision, context, confidence: nil, evaluations_count: 0, duration_ms: nil, status: nil) raise NotImplementedError, "#{self.class} must implement #record_decision" end |
#record_error(error_type, message: nil, stack_trace: nil, severity: nil, context: {}) ⇒ void
This method returns an undefined value.
Record an error
49 50 51 |
# File 'lib/decision_agent/monitoring/storage/base_adapter.rb', line 49 def record_error(error_type, message: nil, stack_trace: nil, severity: nil, context: {}) raise NotImplementedError, "#{self.class} must implement #record_error" end |
#record_evaluation(evaluator_name, score: nil, success: nil, duration_ms: nil, details: {}) ⇒ void
This method returns an undefined value.
Record an evaluation
28 29 30 |
# File 'lib/decision_agent/monitoring/storage/base_adapter.rb', line 28 def record_evaluation(evaluator_name, score: nil, success: nil, duration_ms: nil, details: {}) raise NotImplementedError, "#{self.class} must implement #record_evaluation" end |
#record_performance(operation, duration_ms: nil, status: nil, metadata: {}) ⇒ void
This method returns an undefined value.
Record a performance metric
38 39 40 |
# File 'lib/decision_agent/monitoring/storage/base_adapter.rb', line 38 def record_performance(operation, duration_ms: nil, status: nil, metadata: {}) raise NotImplementedError, "#{self.class} must implement #record_performance" end |
#statistics(time_range: 3600) ⇒ Hash
Get statistics for a time range
56 57 58 |
# File 'lib/decision_agent/monitoring/storage/base_adapter.rb', line 56 def statistics(time_range: 3600) raise NotImplementedError, "#{self.class} must implement #statistics" end |
#time_series(metric_type, bucket_size: 60, time_range: 3600) ⇒ Hash
Get time series data
65 66 67 |
# File 'lib/decision_agent/monitoring/storage/base_adapter.rb', line 65 def time_series(metric_type, bucket_size: 60, time_range: 3600) raise NotImplementedError, "#{self.class} must implement #time_series" end |