//
// Copyright (C) 2024 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// @generated by protoc-gen-es v2.2.2 with parameter "target=ts"
// @generated from file protos/perfetto/metrics/android/auto_metric.proto (package perfetto.protos, syntax proto2)
/* eslint-disable */

import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/metrics/android/auto_metric.proto.
 */
export const file_protos_perfetto_metrics_android_auto_metric: GenFile = /*@__PURE__*/
  fileDesc("CjFwcm90b3MvcGVyZmV0dG8vbWV0cmljcy9hbmRyb2lkL2F1dG9fbWV0cmljLnByb3RvEg9wZXJmZXR0by5wcm90b3Mi9wIKGkFuZHJvaWRBdXRvTXVsdGl1c2VyTWV0cmljEkoKC3VzZXJfc3dpdGNoGAEgAygLMjUucGVyZmV0dG8ucHJvdG9zLkFuZHJvaWRBdXRvTXVsdGl1c2VyTWV0cmljLkV2ZW50RGF0YRqMAgoJRXZlbnREYXRhEg8KB3VzZXJfaWQYASABKAUSEwoLc3RhcnRfZXZlbnQYAiABKAkSEQoJZW5kX2V2ZW50GAMgASgJEhMKC2R1cmF0aW9uX21zGAQgASgDEloKEnByZXZpb3VzX3VzZXJfaW5mbxgFIAEoCzI+LnBlcmZldHRvLnByb3Rvcy5BbmRyb2lkQXV0b011bHRpdXNlck1ldHJpYy5FdmVudERhdGEuVXNlckRhdGEaVQoIVXNlckRhdGESDwoHdXNlcl9pZBgBIAEoBRIZChF0b3RhbF9jcHVfdGltZV9tcxgCIAEoAxIdChV0b3RhbF9tZW1vcnlfdXNhZ2Vfa2IYAyABKAM");

/**
 * Metrics for Multiuser events, such as switching users.
 *
 * @generated from message perfetto.protos.AndroidAutoMultiuserMetric
 */
export type AndroidAutoMultiuserMetric = Message<"perfetto.protos.AndroidAutoMultiuserMetric"> & {
  /**
   * Metrics for a user switch.
   *
   * @generated from field: repeated perfetto.protos.AndroidAutoMultiuserMetric.EventData user_switch = 1;
   */
  userSwitch: AndroidAutoMultiuserMetric_EventData[];
};

/**
 * Describes the message perfetto.protos.AndroidAutoMultiuserMetric.
 * Use `create(AndroidAutoMultiuserMetricSchema)` to create a new message.
 */
export const AndroidAutoMultiuserMetricSchema: GenMessage<AndroidAutoMultiuserMetric> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_metrics_android_auto_metric, 0);

/**
 * @generated from message perfetto.protos.AndroidAutoMultiuserMetric.EventData
 */
export type AndroidAutoMultiuserMetric_EventData = Message<"perfetto.protos.AndroidAutoMultiuserMetric.EventData"> & {
  /**
   * Id of the user the system has been switched to
   *
   * @generated from field: optional int32 user_id = 1;
   */
  userId: number;

  /**
   * The end event name for which the duration_ms is measured
   *
   * @generated from field: optional string start_event = 2;
   */
  startEvent: string;

  /**
   * The end event name for which the duration_ms is measured
   *
   * @generated from field: optional string end_event = 3;
   */
  endEvent: string;

  /**
   * Duration of the event (in milliseconds).
   *
   * @generated from field: optional int64 duration_ms = 4;
   */
  durationMs: bigint;

  /**
   * @generated from field: optional perfetto.protos.AndroidAutoMultiuserMetric.EventData.UserData previous_user_info = 5;
   */
  previousUserInfo?: AndroidAutoMultiuserMetric_EventData_UserData;
};

/**
 * Describes the message perfetto.protos.AndroidAutoMultiuserMetric.EventData.
 * Use `create(AndroidAutoMultiuserMetric_EventDataSchema)` to create a new message.
 */
export const AndroidAutoMultiuserMetric_EventDataSchema: GenMessage<AndroidAutoMultiuserMetric_EventData> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_metrics_android_auto_metric, 0, 0);

/**
 * Previous user resource usage info during user switch
 *
 * @generated from message perfetto.protos.AndroidAutoMultiuserMetric.EventData.UserData
 */
export type AndroidAutoMultiuserMetric_EventData_UserData = Message<"perfetto.protos.AndroidAutoMultiuserMetric.EventData.UserData"> & {
  /**
   * Id of the user the system has been switched from
   *
   * @generated from field: optional int32 user_id = 1;
   */
  userId: number;

  /**
   * @generated from field: optional int64 total_cpu_time_ms = 2;
   */
  totalCpuTimeMs: bigint;

  /**
   * @generated from field: optional int64 total_memory_usage_kb = 3;
   */
  totalMemoryUsageKb: bigint;
};

/**
 * Describes the message perfetto.protos.AndroidAutoMultiuserMetric.EventData.UserData.
 * Use `create(AndroidAutoMultiuserMetric_EventData_UserDataSchema)` to create a new message.
 */
export const AndroidAutoMultiuserMetric_EventData_UserDataSchema: GenMessage<AndroidAutoMultiuserMetric_EventData_UserData> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_metrics_android_auto_metric, 0, 0, 0);

