code: def testMetricsSpecBeamCounter(self):
      with beam.Pipeline() as pipeline:
          metrics_spec = config_pb2.MetricsSpec(
              metrics=[
                  config_pb2.MetricConfig(
                      class_name="FairnessIndicators"
                  )
              ]
          )
          model_types = set(["tf_js", "tf_keras"])
          _ = pipeline | counter_util.IncrementMetricsSpecsCounters(
              [metrics_spec], model_types
          )
  
      result = pipeline.run()
  
      for model_type in model_types:
          metric_filter = (
              beam.metrics.metric.MetricsFilter()
              .with_namespace(constants.METRICS_NAMESPACE)
              .with_name(
                  "metric_computed_FairnessIndicators_v2_" + model_type
              )
          )
          actual_metrics_count = (
              result.metrics()
              .query(filter=metric_filter)["counters"][0]
              .committed
          )
  
          self.assertEqual(actual_metrics_count, 1)
  
file_path: model-analysis/tensorflow_model_analysis/evaluators/counter_util_test.py
imports: import apache_beam
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.evaluators import counter_util
  from tensorflow_model_analysis.post_export_metrics import post_export_metrics
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 3 for calling the CounterUtilTest obj's underlying member method code with example usage: obj.testMetricsSpecBeamCounter() without return types