Class MetricRepository

    • Method Detail

      • instance

        public static MetricRepository instance()
        Returns the singleton instance of MetricRepository.
        Returns:
        The unique instance of this class.
      • getLabels

        public Set<String> getLabels()
        Gets the labels for all metrics in the repository.
        Returns:
        set of labels
      • getMetric

        public Metric getMetric​(String inLabel)
        Gets a Metric with a specified label.
        Parameters:
        inLabel - String label
        Returns:
        Metric with the specified label, or null if one does not exist.
      • putMetric

        public void putMetric​(Metric inMetric)
        Places an instance of Metric into the repository.

        If the repository already contains a Metric with the same label, it is replaced with the specified one.

        Parameters:
        inMetric - Metric to be placed into the repository.
      • get

        public static Metric get​(String inLabel)
        Gets a Metric with a specified label.

        This static method is equivalent to MetricRepository.instance().getMetric(label)

        Parameters:
        inLabel - String label
        Returns:
        Metric with the specified label, or null if one does not exist.
      • put

        public static void put​(Metric inMetric)
        Places an instance of Metric into the repository.

        This static method is equivalent to MetricRepository.instance().putMetric(metric)

        Parameters:
        inMetric - Metric to be placed into the repository