Skip to content

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

This PR implements a comprehensive image loading performance metrics infrastructure for .NET MAUI, following the established diagnostics pattern used by layout metrics. The implementation provides zero-allocation, struct-based instrumentation to monitor image loading performance across all platforms with success and failure monitoring.

Metrics

  • maui.image.load_duration (Histogram, ms): Total duration of image loading operations
  • maui.image.file_size (Histogram, bytes): Original file size of loaded images
  • maui.image.width (Histogram, pixels): Width of loaded images
  • maui.image.height (Histogram, pixels): Height of loaded images
  • maui.image.load_success (Counter): Number of successful image load operations
  • maui.image.load_failures (Counter): Number of failed image load operations

Tags

Each metric supports contextual tags for richer analysis:

  • image.source: The source type (e.g., "File", "Uri", "Stream", "EmbeddedResource")
  • image.format: File format such as "png", "jpeg", "gif", etc.
  • control.type: The consuming control type ("Image", "ImageButton", etc.)
  • error.type: (on failures) The classification of the error (e.g., "FileNotFound", "DecodeError")
  • error.message: (on failures) Optional descriptive error message

Issues Fixed

Related with #29065

@jsuarezruiz jsuarezruiz added t/enhancement ☀️ New feature or request perf/general The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) labels Sep 5, 2025
@jsuarezruiz jsuarezruiz changed the title Image diagnostics metrics Add Image Diagnostics Metrics Tracking to MAUI Applications Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf/general The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) t/enhancement ☀️ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant