Documentation
¶
Overview ¶
File: backend/internal/analytics/analytics_engine.go
File: backend/internal/analytics/export_service.go
Index ¶
- type AdvancedAnalyticsEngine
- func (e *AdvancedAnalyticsEngine) GenerateComparativeAnalytics(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.ComparativeAnalyticsData, error)
- func (e *AdvancedAnalyticsEngine) GeneratePerformanceKPIs(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.PerformanceKPIData, error)
- func (e *AdvancedAnalyticsEngine) GeneratePredictiveAnalytics(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.PredictiveAnalyticsData, error)
- func (e *AdvancedAnalyticsEngine) GenerateResourceAnalytics(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.ResourceAnalyticsData, error)
- func (e *AdvancedAnalyticsEngine) GenerateStealthAnalytics(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.StealthAnalyticsData, error)
- func (e *AdvancedAnalyticsEngine) GenerateVisualizationData(ctx context.Context, campaignID uuid.UUID, ...) (*models.VisualizationDataPrep, error)
- func (e *AdvancedAnalyticsEngine) GenerateVisualizationDataFromRequest(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.VisualizationDataPrep, error)
- type AlertServiceImpl
- type AlertStore
- type BenchmarkDatabase
- type CampaignDataSet
- type CostMetric
- type DataProcessor
- type DetectionEvent
- type EvasionEvent
- type ExportServiceImpl
- type HistoricalDataSet
- type NotificationService
- type PredictiveModelEngine
- func (p *PredictiveModelEngine) GenerateOpportunityPredictions(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.OpportunityPrediction, error)
- func (p *PredictiveModelEngine) GeneratePerformanceForecasts(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.PerformanceForecast, error)
- func (p *PredictiveModelEngine) GenerateResourceForecasts(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.ResourceForecast, error)
- func (p *PredictiveModelEngine) GenerateRiskPredictions(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.RiskPrediction, error)
- func (p *PredictiveModelEngine) GenerateScenarioAnalysis(ctx context.Context, data *HistoricalDataSet, horizon int) (*models.ScenarioAnalysis, error)
- func (p *PredictiveModelEngine) GenerateTrendPredictions(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.TrendPrediction, error)
- func (p *PredictiveModelEngine) GetModelPerformanceMetrics(ctx context.Context) *models.PredictiveModelPerformance
- type ResourceAnalyzer
- func (r *ResourceAnalyzer) AnalyzeCosts(ctx context.Context, data *ResourceDataSet) (*models.ResourceCostAnalysis, error)
- func (r *ResourceAnalyzer) AnalyzeOptimizationOpportunities(data *ResourceDataSet) *models.ResourceOptimizationData
- func (r *ResourceAnalyzer) AnalyzePerformanceCorrelation(data *ResourceDataSet) *models.ResourcePerformanceData
- func (r *ResourceAnalyzer) GenerateAllocationRecommendations(data *ResourceDataSet, capacity *models.CapacityPlanningData) []models.ResourceAllocationRec
- func (r *ResourceAnalyzer) GenerateCapacityPlanningData(ctx context.Context, data *ResourceDataSet) (*models.CapacityPlanningData, error)
- func (r *ResourceAnalyzer) GenerateUtilizationSummary(data *ResourceDataSet) *models.ResourceUtilizationSummary
- type ResourceDataSet
- type ResourceMetric
- type StealthAnalyzer
- func (s *StealthAnalyzer) AnalyzeCountermeasures(data *StealthDataSet) []models.CountermeasureAnalysis
- func (s *StealthAnalyzer) AnalyzeDetectionRisks(ctx context.Context, data *StealthDataSet) (*models.DetectionRiskAnalysis, error)
- func (s *StealthAnalyzer) AnalyzeStealthTechniques(data *StealthDataSet) []models.StealthTechniqueMetrics
- func (s *StealthAnalyzer) CalculateAnonymityMetrics(data *StealthDataSet) *models.AnonymityMetrics
- func (s *StealthAnalyzer) CalculateOverallStealthScore(data *StealthDataSet) float64
- func (s *StealthAnalyzer) CheckStealthCompliance(ctx context.Context, data *StealthDataSet) (*models.StealthComplianceData, error)
- type StealthDataSet
- type StorageService
- type TemplateEngine
- type TrafficPattern
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvancedAnalyticsEngine ¶
type AdvancedAnalyticsEngine struct {
// contains filtered or unexported fields
}
AdvancedAnalyticsEngine - Enterprise-grade analytics engine
func NewAdvancedAnalyticsEngine ¶
func NewAdvancedAnalyticsEngine( orchestrator *application.CampaignOrchestrator, dataProcessor *DataProcessor, modelEngine *PredictiveModelEngine, benchmarkDB *BenchmarkDatabase, stealthAnalyzer *StealthAnalyzer, resourceAnalyzer *ResourceAnalyzer, ) *AdvancedAnalyticsEngine
NewAdvancedAnalyticsEngine - Creates a properly architected analytics engine
func (*AdvancedAnalyticsEngine) GenerateComparativeAnalytics ¶
func (e *AdvancedAnalyticsEngine) GenerateComparativeAnalytics(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.ComparativeAnalyticsData, error)
GenerateComparativeAnalytics - Generate comparative analytics against baselines
func (*AdvancedAnalyticsEngine) GeneratePerformanceKPIs ¶
func (e *AdvancedAnalyticsEngine) GeneratePerformanceKPIs(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.PerformanceKPIData, error)
GeneratePerformanceKPIs - Generate enterprise performance KPIs
func (*AdvancedAnalyticsEngine) GeneratePredictiveAnalytics ¶
func (e *AdvancedAnalyticsEngine) GeneratePredictiveAnalytics(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.PredictiveAnalyticsData, error)
GeneratePredictiveAnalytics - Generate predictive analytics and forecasting
func (*AdvancedAnalyticsEngine) GenerateResourceAnalytics ¶
func (e *AdvancedAnalyticsEngine) GenerateResourceAnalytics(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.ResourceAnalyticsData, error)
GenerateResourceAnalytics - Generate resource utilization and optimization analytics
func (*AdvancedAnalyticsEngine) GenerateStealthAnalytics ¶
func (e *AdvancedAnalyticsEngine) GenerateStealthAnalytics(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.StealthAnalyticsData, error)
GenerateStealthAnalytics - Generate stealth operation analytics
func (*AdvancedAnalyticsEngine) GenerateVisualizationData ¶
func (e *AdvancedAnalyticsEngine) GenerateVisualizationData(ctx context.Context, campaignID uuid.UUID, chartType, timeRange, granularity string) (*models.VisualizationDataPrep, error)
GenerateVisualizationData - Generate visualization data for specific campaign
func (*AdvancedAnalyticsEngine) GenerateVisualizationDataFromRequest ¶
func (e *AdvancedAnalyticsEngine) GenerateVisualizationDataFromRequest(ctx context.Context, request *models.AdvancedBulkAnalyticsRequest) (*models.VisualizationDataPrep, error)
GenerateVisualizationDataFromRequest - Generate visualization data from analytics request
type AlertServiceImpl ¶
type AlertServiceImpl struct {
// contains filtered or unexported fields
}
AlertServiceImpl - Alert service that actually monitors things
func NewAlertService ¶
func NewAlertService(alertStore AlertStore, notificationService NotificationService) *AlertServiceImpl
NewAlertService - Creates an alert service that works
func (*AlertServiceImpl) CheckThresholds ¶
func (s *AlertServiceImpl) CheckThresholds(ctx context.Context, data *models.AdvancedBulkAnalyticsResponse, thresholds *models.AnalyticsAlertConfig) ([]models.AnalyticsAlert, error)
CheckThresholds - Check analytics data against thresholds and generate alerts
func (*AlertServiceImpl) GetActiveAlerts ¶
func (s *AlertServiceImpl) GetActiveAlerts(ctx context.Context, severityFilter string, limit int) ([]models.AnalyticsAlert, error)
GetActiveAlerts - Retrieve active alerts with optional filtering
type AlertStore ¶
type BenchmarkDatabase ¶
type BenchmarkDatabase struct{}
Concrete types instead of broken interface pattern
type CampaignDataSet ¶
type CampaignDataSet struct {
// Basic operational data
TotalOperations int64
SuccessfulOperations int64
TotalProcessingTime int64 // milliseconds
TimeSpan time.Duration
UptimePercentage float64
ConcurrentOperations int64
QueueLength int64
// Resource utilization
CPUUtilization float64
MemoryUtilization float64
NetworkUtilization float64
StorageUtilization float64
// Business metrics
LeadsGenerated int64
QualifiedLeads int64
Conversions int64
TotalCost float64
TotalRevenue float64
TargetMarketSize int64
// Technical metrics
DataPointsProcessed int64
ValidDataPoints int64
StealthScore float64
PerformanceDegradation float64
CPUHealth float64
MemoryHealth float64
NetworkHealth float64
StorageHealth float64
TestCoverage float64
DeploymentAttempts int64
SuccessfulDeployments int64
AverageRecoveryTime int64
AverageResponseTime int64
// User experience metrics
UserSatisfactionRating float64
InterfaceUsabilityScore float64
TotalUsers int64
ActiveFeatureUsers int64
ReturnUsers int64
AverageSupportResolutionTime int64
AverageSessionDuration float64
}
CampaignDataSet - Comprehensive campaign data for analytics
type CostMetric ¶
CostMetric - Cost tracking metric
type DataProcessor ¶
type DataProcessor interface {
ProcessCampaignData(ctx context.Context, campaignIDs []uuid.UUID, timeRange *models.TimeRangeFilter) (*CampaignDataSet, error)
ProcessStealthData(ctx context.Context, campaignIDs []uuid.UUID, timeRange *models.TimeRangeFilter) (*StealthDataSet, error)
ProcessResourceData(ctx context.Context, campaignIDs []uuid.UUID, timeRange *models.TimeRangeFilter) (*ResourceDataSet, error)
}
DataProcessor - Interface for data processing operations
type DetectionEvent ¶
type DetectionEvent struct {
Timestamp time.Time
EventType string
Severity string
Source string
Mitigated bool
}
DetectionEvent - Detection event data
type EvasionEvent ¶
EvasionEvent - Successful evasion event
type ExportServiceImpl ¶
type ExportServiceImpl struct {
// contains filtered or unexported fields
}
ExportServiceImpl - Actually functional export service
func NewExportService ¶
func NewExportService(storageService StorageService, templateEngine TemplateEngine) *ExportServiceImpl
NewExportService - Creates an export service that actually works
func (*ExportServiceImpl) ExportAnalytics ¶
func (s *ExportServiceImpl) ExportAnalytics(ctx context.Context, data *models.AdvancedBulkAnalyticsResponse, format string) (*models.ExportInfo, error)
ExportAnalytics - Export analytics data in specified format
type HistoricalDataSet ¶
type HistoricalDataSet struct {
CampaignData []CampaignDataSet
TimeRange time.Duration
}
HistoricalDataSet - Historical data for predictive modeling
type NotificationService ¶
type NotificationService interface {
SendAlert(ctx context.Context, alert *models.AnalyticsAlert) error
}
type PredictiveModelEngine ¶
type PredictiveModelEngine struct{}
func (*PredictiveModelEngine) GenerateOpportunityPredictions ¶
func (p *PredictiveModelEngine) GenerateOpportunityPredictions(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.OpportunityPrediction, error)
func (*PredictiveModelEngine) GeneratePerformanceForecasts ¶
func (p *PredictiveModelEngine) GeneratePerformanceForecasts(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.PerformanceForecast, error)
Placeholder methods for predictive model engine
func (*PredictiveModelEngine) GenerateResourceForecasts ¶
func (p *PredictiveModelEngine) GenerateResourceForecasts(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.ResourceForecast, error)
func (*PredictiveModelEngine) GenerateRiskPredictions ¶
func (p *PredictiveModelEngine) GenerateRiskPredictions(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.RiskPrediction, error)
func (*PredictiveModelEngine) GenerateScenarioAnalysis ¶
func (p *PredictiveModelEngine) GenerateScenarioAnalysis(ctx context.Context, data *HistoricalDataSet, horizon int) (*models.ScenarioAnalysis, error)
func (*PredictiveModelEngine) GenerateTrendPredictions ¶
func (p *PredictiveModelEngine) GenerateTrendPredictions(ctx context.Context, data *HistoricalDataSet, horizon int) ([]models.TrendPrediction, error)
func (*PredictiveModelEngine) GetModelPerformanceMetrics ¶
func (p *PredictiveModelEngine) GetModelPerformanceMetrics(ctx context.Context) *models.PredictiveModelPerformance
type ResourceAnalyzer ¶
type ResourceAnalyzer struct{}
func (*ResourceAnalyzer) AnalyzeCosts ¶
func (r *ResourceAnalyzer) AnalyzeCosts(ctx context.Context, data *ResourceDataSet) (*models.ResourceCostAnalysis, error)
func (*ResourceAnalyzer) AnalyzeOptimizationOpportunities ¶
func (r *ResourceAnalyzer) AnalyzeOptimizationOpportunities(data *ResourceDataSet) *models.ResourceOptimizationData
func (*ResourceAnalyzer) AnalyzePerformanceCorrelation ¶
func (r *ResourceAnalyzer) AnalyzePerformanceCorrelation(data *ResourceDataSet) *models.ResourcePerformanceData
func (*ResourceAnalyzer) GenerateAllocationRecommendations ¶
func (r *ResourceAnalyzer) GenerateAllocationRecommendations(data *ResourceDataSet, capacity *models.CapacityPlanningData) []models.ResourceAllocationRec
func (*ResourceAnalyzer) GenerateCapacityPlanningData ¶
func (r *ResourceAnalyzer) GenerateCapacityPlanningData(ctx context.Context, data *ResourceDataSet) (*models.CapacityPlanningData, error)
func (*ResourceAnalyzer) GenerateUtilizationSummary ¶
func (r *ResourceAnalyzer) GenerateUtilizationSummary(data *ResourceDataSet) *models.ResourceUtilizationSummary
Placeholder methods for resource analyzer
type ResourceDataSet ¶
type ResourceDataSet struct {
CampaignIDs []uuid.UUID
CPUMetrics []ResourceMetric
MemoryMetrics []ResourceMetric
NetworkMetrics []ResourceMetric
StorageMetrics []ResourceMetric
ProxyMetrics []ResourceMetric
DatabaseMetrics []ResourceMetric
CostMetrics []CostMetric
}
ResourceDataSet - Resource-specific data
type ResourceMetric ¶
type ResourceMetric struct {
Timestamp time.Time
Usage float64
Capacity float64
Efficiency float64
Cost float64
}
ResourceMetric - Individual resource metric
type StealthAnalyzer ¶
type StealthAnalyzer struct{}
func (*StealthAnalyzer) AnalyzeCountermeasures ¶
func (s *StealthAnalyzer) AnalyzeCountermeasures(data *StealthDataSet) []models.CountermeasureAnalysis
func (*StealthAnalyzer) AnalyzeDetectionRisks ¶
func (s *StealthAnalyzer) AnalyzeDetectionRisks(ctx context.Context, data *StealthDataSet) (*models.DetectionRiskAnalysis, error)
func (*StealthAnalyzer) AnalyzeStealthTechniques ¶
func (s *StealthAnalyzer) AnalyzeStealthTechniques(data *StealthDataSet) []models.StealthTechniqueMetrics
func (*StealthAnalyzer) CalculateAnonymityMetrics ¶
func (s *StealthAnalyzer) CalculateAnonymityMetrics(data *StealthDataSet) *models.AnonymityMetrics
func (*StealthAnalyzer) CalculateOverallStealthScore ¶
func (s *StealthAnalyzer) CalculateOverallStealthScore(data *StealthDataSet) float64
Placeholder method for stealth analyzer
func (*StealthAnalyzer) CheckStealthCompliance ¶
func (s *StealthAnalyzer) CheckStealthCompliance(ctx context.Context, data *StealthDataSet) (*models.StealthComplianceData, error)
type StealthDataSet ¶
type StealthDataSet struct {
CampaignIDs []uuid.UUID
DetectionEvents []DetectionEvent
EvasionSuccesses []EvasionEvent
StealthTechniques map[string]float64 // technique -> effectiveness
ProxyRotations int64
UserAgentRotations int64
TimingVariations []float64
AnonymitySetSize int64
TrafficPatterns []TrafficPattern
}
StealthDataSet - Stealth-specific data
type StorageService ¶
type TemplateEngine ¶
type TemplateEngine interface {
GenerateHTMLReport(data *models.AdvancedBulkAnalyticsResponse) (string, error)
}