//
// Copyright (C) 2021 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/multiuser_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/multiuser_metric.proto.
 */
export const file_protos_perfetto_metrics_android_multiuser_metric: GenFile = /*@__PURE__*/
  fileDesc("CjZwcm90b3MvcGVyZmV0dG8vbWV0cmljcy9hbmRyb2lkL211bHRpdXNlcl9tZXRyaWMucHJvdG8SD3BlcmZldHRvLnByb3RvcyLGAgoWQW5kcm9pZE11bHRpdXNlck1ldHJpYxJGCgt1c2VyX3N3aXRjaBgBIAEoCzIxLnBlcmZldHRvLnByb3Rvcy5BbmRyb2lkTXVsdGl1c2VyTWV0cmljLkV2ZW50RGF0YRrjAQoJRXZlbnREYXRhEhMKC2R1cmF0aW9uX21zGAEgASgFEk0KCWNwdV91c2FnZRgCIAMoCzI6LnBlcmZldHRvLnByb3Rvcy5BbmRyb2lkTXVsdGl1c2VyTWV0cmljLkV2ZW50RGF0YS5DcHVVc2FnZRpyCghDcHVVc2FnZRIPCgd1c2VyX2lkGAEgASgFEhQKDHByb2Nlc3NfbmFtZRgCIAEoCRITCgtjcHVfbWN5Y2xlcxgDIAEoBRIWCg5jcHVfcGVyY2VudGFnZRgEIAEoAhISCgppZGVudGlmaWVyGAUgASgJ");

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

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

/**
 * Holds the data for a Multiuser event.
 *
 * @generated from message perfetto.protos.AndroidMultiuserMetric.EventData
 */
export type AndroidMultiuserMetric_EventData = Message<"perfetto.protos.AndroidMultiuserMetric.EventData"> & {
  /**
   * Duration of the event (in milliseconds).
   *
   * @generated from field: optional int32 duration_ms = 1;
   */
  durationMs: number;

  /**
   * @generated from field: repeated perfetto.protos.AndroidMultiuserMetric.EventData.CpuUsage cpu_usage = 2;
   */
  cpuUsage: AndroidMultiuserMetric_EventData_CpuUsage[];
};

/**
 * Describes the message perfetto.protos.AndroidMultiuserMetric.EventData.
 * Use `create(AndroidMultiuserMetric_EventDataSchema)` to create a new message.
 */
export const AndroidMultiuserMetric_EventDataSchema: GenMessage<AndroidMultiuserMetric_EventData> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_metrics_android_multiuser_metric, 0, 0);

/**
 * CPU usage of each process during the event.
 *
 * @generated from message perfetto.protos.AndroidMultiuserMetric.EventData.CpuUsage
 */
export type AndroidMultiuserMetric_EventData_CpuUsage = Message<"perfetto.protos.AndroidMultiuserMetric.EventData.CpuUsage"> & {
  /**
   * The userId of the process (e.g. 0 or 10).
   *
   * @generated from field: optional int32 user_id = 1;
   */
  userId: number;

  /**
   * The name of the process.
   *
   * @generated from field: optional string process_name = 2;
   */
  processName: string;

  /**
   * The number of CPU cycles (in megacycles) spent by that process during the event.
   *
   * @generated from field: optional int32 cpu_mcycles = 3;
   */
  cpuMcycles: number;

  /**
   * The ratio of this process's cycles to the total for all processes, expressed as a percentage.
   *
   * @generated from field: optional float cpu_percentage = 4;
   */
  cpuPercentage: number;

  /**
   * General identifier for this usage source: determined from the process name, user, etc.
   * Should be stable across multiple runs (i.e. does not print the user_id directly).
   *
   * @generated from field: optional string identifier = 5;
   */
  identifier: string;
};

/**
 * Describes the message perfetto.protos.AndroidMultiuserMetric.EventData.CpuUsage.
 * Use `create(AndroidMultiuserMetric_EventData_CpuUsageSchema)` to create a new message.
 */
export const AndroidMultiuserMetric_EventData_CpuUsageSchema: GenMessage<AndroidMultiuserMetric_EventData_CpuUsage> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_metrics_android_multiuser_metric, 0, 0, 0);

