Class AbstractMetricService

  • Direct Known Subclasses:
    DoNothingMetricService

    public abstract class AbstractMetricService
    extends Object
    MetricService is the entry to get all metric features.
    • Field Detail

      • METRIC_CONFIG

        protected static final MetricConfig METRIC_CONFIG
        The config of metric service.
      • compositeReporter

        protected CompositeReporter compositeReporter
        The metric reporter of metric service.
      • internalReporter

        protected IoTDBInternalReporter internalReporter
        The internal reporter of metric service.
      • metricSets

        protected Set<IMetricSet> metricSets
        The list of metric sets.
    • Constructor Detail

      • AbstractMetricService

        protected AbstractMetricService()
    • Method Detail

      • startService

        public void startService()
        Start metric service.
      • stopService

        public void stopService()
        Stop metric service.
      • startCoreModule

        protected void startCoreModule()
        Start metric core module.
      • stopCoreModule

        protected void stopCoreModule()
        Stop metric core module.
      • loadManager

        protected abstract void loadManager()
        Load metric manager according to configuration.
      • loadReporter

        protected abstract void loadReporter()
        Load metric reporters according to configuration.
      • reloadInternalReporter

        public abstract void reloadInternalReporter​(IoTDBInternalReporter internalReporter)
        Reload internal reporter.
        Parameters:
        internalReporter - the new internal reporter
      • reloadService

        protected abstract void reloadService​(ReloadLevel reloadLevel)
        Reload metric service.
        Parameters:
        reloadLevel - the level of reload
      • startAllReporter

        public void startAllReporter()
        Start all reporters.
      • stopAllReporter

        public void stopAllReporter()
        Stop all reporters.
      • start

        public void start​(ReporterType type)
        Start reporter according to type.
      • stop

        public void stop​(ReporterType type)
        Stop reporter according to type.
      • getOrCreateCounterWithInternalReport

        public Counter getOrCreateCounterWithInternalReport​(String metric,
                                                            MetricLevel metricLevel,
                                                            long time,
                                                            String... tags)
        GetOrCreateCounter with internal report.
      • getOrCreateGaugeWithInternalReport

        public Gauge getOrCreateGaugeWithInternalReport​(String metric,
                                                        MetricLevel metricLevel,
                                                        long time,
                                                        String... tags)
        GetOrCreateGauge with internal report.
      • getOrCreateRateWithInternalReport

        public Rate getOrCreateRateWithInternalReport​(String metric,
                                                      MetricLevel metricLevel,
                                                      long time,
                                                      String... tags)
        GetOrCreateRate with internal report.
      • getOrCreateHistogramWithInternalReport

        public Histogram getOrCreateHistogramWithInternalReport​(String metric,
                                                                MetricLevel metricLevel,
                                                                long time,
                                                                String... tags)
        GetOrCreateHistogram with internal report.
      • getOrCreateTimerWithInternalReport

        public Timer getOrCreateTimerWithInternalReport​(String metric,
                                                        MetricLevel metricLevel,
                                                        long time,
                                                        String... tags)
        GetOrCreateTimer with internal report.
      • countWithInternalReportAsync

        public void countWithInternalReportAsync​(long delta,
                                                 String metric,
                                                 MetricLevel metricLevel,
                                                 long time,
                                                 String... tags)
        Count with internal report.
      • gaugeWithInternalReportAsync

        public void gaugeWithInternalReportAsync​(long value,
                                                 String metric,
                                                 MetricLevel metricLevel,
                                                 long time,
                                                 String... tags)
        Gauge value with internal report.
      • rateWithInternalReportAsync

        public void rateWithInternalReportAsync​(long value,
                                                String metric,
                                                MetricLevel metricLevel,
                                                long time,
                                                String... tags)
        Rate with internal report.
      • histogramWithInternalReportAsync

        public void histogramWithInternalReportAsync​(long value,
                                                     String metric,
                                                     MetricLevel metricLevel,
                                                     long time,
                                                     String... tags)
        Histogram with internal report.
      • timerWithInternalReportAsync

        public void timerWithInternalReportAsync​(long delta,
                                                 TimeUnit timeUnit,
                                                 String metric,
                                                 MetricLevel metricLevel,
                                                 long time,
                                                 String... tags)
        Timer with internal report.
      • addMetricSet

        public void addMetricSet​(IMetricSet metricSet)
        Bind metrics and store metric set.
      • removeMetricSet

        public void removeMetricSet​(IMetricSet metricSet)
        Remove metrics.