Documentation
¶
Index ¶
- func BuildResourceGroupPortalURL(tenantID, subscriptionID, resourceGroupName string) string
- func BuildResourcePortalURL(tenantID, resourceID string) string
- func BuildSubscriptionPortalURL(tenantID, subscriptionID string) string
- func CloseLogger()
- func CopyToClipboard(text string) error
- func GetLogPath() string
- func InitLogger() error
- func IsClipboardAvailable() bool
- func IsDebugEnabled() bool
- func Log(format string, args ...interface{})
- func LogMetrics()
- func OpenBrowser(url string) error
- func StartAPITimer(operation string) func(error)
- type Metrics
- func (m *Metrics) GetCacheHitRate() float64
- func (m *Metrics) GetStats() MetricsSnapshot
- func (m *Metrics) RecordAPICall(duration time.Duration, err error)
- func (m *Metrics) RecordCacheHit()
- func (m *Metrics) RecordCacheMiss()
- func (m *Metrics) RecordEviction(count int)
- func (m *Metrics) Reset()
- func (m *Metrics) UpdateCacheSize(rgCount, resCount, fullResCount int)
- type MetricsSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildResourceGroupPortalURL ¶
BuildResourceGroupPortalURL builds the Azure Portal URL for a resource group
func BuildResourcePortalURL ¶
BuildResourcePortalURL builds the Azure Portal URL for a resource Note: resourceID should start with / (e.g., /subscriptions/...)
func BuildSubscriptionPortalURL ¶
BuildSubscriptionPortalURL builds the Azure Portal URL for a subscription
func CopyToClipboard ¶
CopyToClipboard copies text to the system clipboard
func GetLogPath ¶
func GetLogPath() string
GetLogPath returns the current log file path (empty if logging disabled)
func InitLogger ¶
func InitLogger() error
InitLogger initializes the debug logger if LAZYAZURE_DEBUG is set
func IsClipboardAvailable ¶
func IsClipboardAvailable() bool
IsClipboardAvailable checks if the clipboard is available on the system
func IsDebugEnabled ¶
func IsDebugEnabled() bool
IsDebugEnabled returns true if debug logging is enabled
func Log ¶
func Log(format string, args ...interface{})
Log writes a log message with timestamp (no-op if debug logging is disabled)
func LogMetrics ¶ added in v0.4.0
func LogMetrics()
LogMetrics logs current metrics to the debug log
func OpenBrowser ¶ added in v0.2.0
OpenBrowser opens the given URL in the system's default browser This is cross-platform and works on Linux (xdg-open), macOS (open), and Windows (start)
func StartAPITimer ¶ added in v0.4.0
StartAPITimer starts a timer for an API call and returns a function to record the result Usage: defer StartAPITimer("operation")()
Types ¶
type Metrics ¶ added in v0.4.0
type Metrics struct {
// contains filtered or unexported fields
}
Metrics provides performance tracking for cache operations and API calls
func GetMetrics ¶ added in v0.4.0
func GetMetrics() *Metrics
GetMetrics returns the global metrics instance
func (*Metrics) GetCacheHitRate ¶ added in v0.4.0
GetCacheHitRate returns the cache hit rate as a percentage
func (*Metrics) GetStats ¶ added in v0.4.0
func (m *Metrics) GetStats() MetricsSnapshot
GetStats returns a snapshot of current metrics
func (*Metrics) RecordAPICall ¶ added in v0.4.0
RecordAPICall records an API call with its duration
func (*Metrics) RecordCacheHit ¶ added in v0.4.0
func (m *Metrics) RecordCacheHit()
RecordCacheHit records a cache hit
func (*Metrics) RecordCacheMiss ¶ added in v0.4.0
func (m *Metrics) RecordCacheMiss()
RecordCacheMiss records a cache miss
func (*Metrics) RecordEviction ¶ added in v0.4.0
RecordEviction records a cache eviction
func (*Metrics) Reset ¶ added in v0.4.0
func (m *Metrics) Reset()
Reset clears all metrics (useful for testing)
func (*Metrics) UpdateCacheSize ¶ added in v0.4.0
UpdateCacheSize updates the current cache size tracking
type MetricsSnapshot ¶ added in v0.4.0
type MetricsSnapshot struct {
CacheHits int64
CacheMisses int64
CacheHitRate float64
Evictions int64
APICalls int64
APIErrors int64
AvgAPIDuration time.Duration
CurrentRGSize int
CurrentResSize int
CurrentFullResSize int
MaxRGSize int
MaxResSize int
MaxFullResSize int
}
MetricsSnapshot provides a point-in-time view of metrics
func (MetricsSnapshot) String ¶ added in v0.4.0
func (s MetricsSnapshot) String() string
String returns a formatted string representation of metrics