tracking

package
v0.0.0-...-17e6b21 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyUsageStats

type KeyUsageStats struct {
	KeyID           string
	Algorithm       string
	TotalUsage      int64
	LastUsed        time.Time
	OperationCounts map[string]int64
	AccessPatterns  map[string]int64
	UsageHistory    []UsageEvent
}

type KeyUsageTracker

type KeyUsageTracker struct {
	// contains filtered or unexported fields
}

func NewKeyUsageTracker

func NewKeyUsageTracker(
	metrics *metrics.QuantumStorageMetrics,
	tracer tracing.Tracer,
) *KeyUsageTracker

func (*KeyUsageTracker) AnalyzeUsagePatterns

func (t *KeyUsageTracker) AnalyzeUsagePatterns(ctx context.Context, keyID string) (map[string]interface{}, error)

func (*KeyUsageTracker) GetUsageStats

func (t *KeyUsageTracker) GetUsageStats(ctx context.Context, keyID string) (*KeyUsageStats, error)

func (*KeyUsageTracker) TrackUsage

func (t *KeyUsageTracker) TrackUsage(ctx context.Context, keyID string, operation string, algorithm string) func(error)

type UsageEvent

type UsageEvent struct {
	Timestamp   time.Time
	Operation   string
	ClientInfo  string
	Duration    time.Duration
	Status      string
	ErrorDetail string
}

Jump to

Keyboard shortcuts

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