MetricData Class

Overview

The MetricData case class is a part of the org.sunbird.obsrv.job.model.Models package. It encapsulates metric information, including a map of metric names to their values and a list of labels associated with these metrics. This class is useful for representing and managing metrics data within the application.

Class Definition

package org.sunbird.obsrv.job.model.Models

case class MetricData(
  metric: Map[String, Long],
  labels: List[Map[String, String]]
)

Fields

metric: Map[String, Long]

  • Description: A map where the keys are metric names and the values are the corresponding metric values.

  • Type: Map[String, Long]

labels: List[Map[String, String]]

  • Description: A list of maps, where each map represents a set of labels associated with the metrics.

  • Type: List[Map[String, String]]

Usage

The MetricData case class is used to encapsulate and manage metrics data, including the metric values and their associated labels. It provides a structured way to represent metrics in the application.

Example

JSON Representation

An instance of MetricData can be serialized to JSON as follows: