analytics

package
v0.0.0-...-7f6939c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

File: backend/internal/analytics/analytics_engine.go

File: backend/internal/analytics/export_service.go

Index

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

GenerateComparativeAnalytics - Generate comparative analytics against baselines

func (*AdvancedAnalyticsEngine) GeneratePerformanceKPIs

GeneratePerformanceKPIs - Generate enterprise performance KPIs

func (*AdvancedAnalyticsEngine) GeneratePredictiveAnalytics

GeneratePredictiveAnalytics - Generate predictive analytics and forecasting

func (*AdvancedAnalyticsEngine) GenerateResourceAnalytics

GenerateResourceAnalytics - Generate resource utilization and optimization analytics

func (*AdvancedAnalyticsEngine) GenerateStealthAnalytics

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

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 AlertStore interface {
	StoreAlert(ctx context.Context, alert *models.AnalyticsAlert) error
	GetActiveAlerts(ctx context.Context, severityFilter string, limit int) ([]models.AnalyticsAlert, error)
}

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

type CostMetric struct {
	Timestamp time.Time
	Category  string
	Amount    float64
	Unit      string
}

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

type EvasionEvent struct {
	Timestamp     time.Time
	Technique     string
	Effectiveness float64
}

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

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 (*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 StorageService interface {
	StoreExport(ctx context.Context, filename string, data []byte) (string, error)
}

type TemplateEngine

type TemplateEngine interface {
	GenerateHTMLReport(data *models.AdvancedBulkAnalyticsResponse) (string, error)
}

type TrafficPattern

type TrafficPattern struct {
	Timestamp time.Time
	Pattern   string
	Anomaly   bool
	Risk      float64
}

TrafficPattern - Traffic pattern analysis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL