chromium/components/lens/proto/v1/lens_latencies_metadata.proto

// lens_latencies_metadata.proto
// Define latency measurements and metadata for Google Lens defined in

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package lens.proto.lens_latencies_metadata;

message ChromeSpecificPhaseLatenciesMetadata {
  enum ImageType {
    UNKNOWN = 0;
    JPEG = 1;
    PNG = 2;
    WEBP = 3;
  }

  message Phase {
    enum PhaseType {
      UNKNOWN_PHASE = 0;
      OVERALL_START = 1;
      IMAGE_DOWNSCALE_START = 2;
      IMAGE_DOWNSCALE_END = 3;
      IMAGE_ENCODE_START = 4;
      IMAGE_ENCODE_END = 5;
    }

    message Timestamp {
      // Represents seconds of UTC time since Unix epoch
      // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
      // 9999-12-31T23:59:59Z inclusive.
      optional int64 seconds = 1;

      // Non-negative fractions of a second at nanosecond resolution. Negative
      // second values with fractions must still have non-negative nanos values
      // that count forward in time. Must be from 0 to 999,999,999
      // inclusive.
      optional int32 nanos = 2;
    }

    optional PhaseType phase_type = 1;
    optional Timestamp timestamp = 2;

    // data specific for each PhaseType. These should only be populated for
    // "_END" PhaseTypes.
    oneof phase_data {
      // Data specifically only relevant for IMAGE_DOWNSCALE_END PhaseType.
      ImageDownscaleData image_downscale_data = 3;
      // Data specifically only relevant for IMAGE_ENCODE_END PhaseType.
      ImageEncodeData image_encode_data = 4;
    }

    message ImageDownscaleData {
      // The size of the original image.
      optional int64 original_image_size = 1;
      // The size of the downscaled image.
      optional int64 downscaled_image_byte_size = 2;
    }

    message ImageEncodeData {
      // The type of the original Image. This only applies to IMAGE_ENCODE_END
      // PhaseTypes
      optional ImageType original_image_type = 1;
      // The bytes size of the encoded image.
      optional int64 encoded_image_size_bytes = 2;
    }
  }

  repeated Phase phase = 1;
}