xref: /aosp_15_r20/external/angle/build/util/lib/proto/measure.py (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker#!/usr/bin/env vpython3
2*8975f5c5SAndroid Build Coastguard Worker
3*8975f5c5SAndroid Build Coastguard Worker# Copyright 2024 The Chromium Authors
4*8975f5c5SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
5*8975f5c5SAndroid Build Coastguard Worker# found in the LICENSE file.
6*8975f5c5SAndroid Build Coastguard Worker""" The base class of all the measurement supported by the metric. """
7*8975f5c5SAndroid Build Coastguard Worker
8*8975f5c5SAndroid Build Coastguard Workerfrom abc import ABC, abstractmethod
9*8975f5c5SAndroid Build Coastguard Workerfrom test_script_metrics_pb2 import TestScriptMetric
10*8975f5c5SAndroid Build Coastguard Worker
11*8975f5c5SAndroid Build Coastguard Worker
12*8975f5c5SAndroid Build Coastguard Workerclass Measure(ABC):
13*8975f5c5SAndroid Build Coastguard Worker
14*8975f5c5SAndroid Build Coastguard Worker  @abstractmethod
15*8975f5c5SAndroid Build Coastguard Worker  def dump(self) -> TestScriptMetric:
16*8975f5c5SAndroid Build Coastguard Worker    """Dumps the data into a TestScriptMetric instance.
17*8975f5c5SAndroid Build Coastguard Worker
18*8975f5c5SAndroid Build Coastguard Worker    Returns:
19*8975f5c5SAndroid Build Coastguard Worker        TestScriptMetric: A protobuf instance to represent the metric data.
20*8975f5c5SAndroid Build Coastguard Worker    """
21