Tabnine Logo
pl.allegro.tech.hermes.common.metric
Code IndexAdd Tabnine to your IDE (free)

How to use pl.allegro.tech.hermes.common.metric

Best Java code snippets using pl.allegro.tech.hermes.common.metric (Showing top 20 results out of 315)

origin: allegro/hermes

public double getBufferTotalBytes() {
  return getDoubleValue(LEADER_CONFIRMS_BUFFER_TOTAL_BYTES)
      + getDoubleValue(EVERYONE_CONFIRMS_BUFFER_TOTAL_BYTES);
}
origin: allegro/hermes

public InstrumentedExecutorService(ExecutorService delegate, HermesMetrics hermesMetrics, String name) {
  this.delegate = delegate;
  this.submitted = hermesMetrics.executorSubmittedMeter(name);
  this.running = hermesMetrics.executorRunningCounter(name);
  this.completed = hermesMetrics.executorCompletedMeter(name);
  this.duration = hermesMetrics.executorDurationTimer(name);
  this.waiting = hermesMetrics.executorWaitingTimer(name);
}
origin: allegro/hermes

public InstrumentedScheduledExecutorService(ScheduledExecutorService delegate, HermesMetrics hermesMetrics, String name) {
  super(delegate, hermesMetrics, name);
  this.delegate = delegate;
  this.scheduledOverrun = hermesMetrics.scheduledExecutorOverrun(name);
}
origin: allegro/hermes

MaxRateCalculator(SubscriptionAssignmentCache subscriptionAssignmentCache,
         SubscriptionsCache subscriptionsCache,
         MaxRateBalancer balancer,
         MaxRateRegistry maxRateRegistry,
         HermesMetrics metrics,
         Clock clock) {
  this.subscriptionAssignmentCache = subscriptionAssignmentCache;
  this.subscriptionsCache = subscriptionsCache;
  this.balancer = balancer;
  this.maxRateRegistry = maxRateRegistry;
  this.metrics = metrics;
  this.clock = clock;
  metrics.registerGauge(Gauges.MAX_RATE_CALCULATION_DURATION, () -> lastUpdateDurationMillis);
}
origin: pl.allegro.tech.hermes/hermes-consumers

  public void shutdown() {
    maxRateSupervisor.unregister(this);
    metrics.unregisterMaxRateGauge(subscription);
    metrics.unregisterRateGauge(subscription);
  }
}
origin: allegro/hermes

public ConsumerLatencyTimer(HermesMetrics hermesMetrics, TopicName topicName, String subscriptionName) {
  latencyTimer = hermesMetrics.timer(Timers.LATENCY);
  subscriptionLatencyTimer = hermesMetrics.timer(Timers.SUBSCRIPTION_LATENCY, topicName, subscriptionName);
}
origin: allegro/hermes

public void start() {
  maxRateSupervisor.register(this);
  metrics.registerMaxRateGauge(subscription, this::get);
  metrics.registerRateGauge(subscription, sendCounters::getRate);
}
origin: allegro/hermes

private boolean isBufferEmpty() {
  long bufferUsedBytes = (long)(metrics.getBufferTotalBytes() - metrics.getBufferAvailablesBytes());
  logger.info("Buffer flush: {} bytes still in use", bufferUsedBytes);
  return  bufferUsedBytes < TOLERANCE_BYTES;
}
origin: allegro/hermes

public Meter meter(String metric) {
  return metricRegistry.meter(metricRegistryName(metric));
}
origin: allegro/hermes

public HermesShutdownHandler(HttpHandler next, HermesMetrics metrics) {
  this.next = next;
  this.metrics = metrics;
  metrics.registerProducerInflightRequest(() -> inflightRequests.get());
}
origin: allegro/hermes

public void decrementInflightCounter(Subscription subscription) {
  getInflightCounter(subscription).dec();
}
origin: pl.allegro.tech.hermes/hermes-consumers

MaxRateCalculator(SubscriptionAssignmentCache subscriptionAssignmentCache,
         SubscriptionsCache subscriptionsCache,
         MaxRateBalancer balancer,
         MaxRateRegistry maxRateRegistry,
         HermesMetrics metrics,
         Clock clock) {
  this.subscriptionAssignmentCache = subscriptionAssignmentCache;
  this.subscriptionsCache = subscriptionsCache;
  this.balancer = balancer;
  this.maxRateRegistry = maxRateRegistry;
  this.metrics = metrics;
  this.clock = clock;
  metrics.registerGauge(Gauges.MAX_RATE_CALCULATION_DURATION, () -> lastUpdateDurationMillis);
}
origin: allegro/hermes

  public void shutdown() {
    maxRateSupervisor.unregister(this);
    metrics.unregisterMaxRateGauge(subscription);
    metrics.unregisterRateGauge(subscription);
  }
}
origin: allegro/hermes

public Counter counter(String metric, TopicName topicName) {
  return metricRegistry.counter(metricRegistryName(metric, topicName));
}
origin: allegro/hermes

public double getBufferAvailablesBytes() {
  return getDoubleValue(LEADER_CONFIRMS_BUFFER_AVAILABLE_BYTES)
      + getDoubleValue(EVERYONE_CONFIRMS_BUFFER_AVAILABLE_BYTES);
}
origin: allegro/hermes

public ConsumersRuntimeMonitor(ConsumersSupervisor consumerSupervisor,
                SupervisorController workloadSupervisor,
                HermesMetrics hermesMetrics,
                SubscriptionsCache subscriptionsCache, ConfigFactory configFactory) {
  this.consumerSupervisor = consumerSupervisor;
  this.workloadSupervisor = workloadSupervisor;
  this.subscriptionsCache = subscriptionsCache;
  this.scanIntervalSeconds = configFactory.getIntProperty(Configs.CONSUMER_WORKLOAD_MONITOR_SCAN_INTERVAL);
  hermesMetrics.registerGauge("consumers-workload.monitor.running", () -> monitorMetrics.running);
  hermesMetrics.registerGauge("consumers-workload.monitor.assigned", () -> monitorMetrics.assigned);
  hermesMetrics.registerGauge("consumers-workload.monitor.missing", () -> monitorMetrics.missing);
  hermesMetrics.registerGauge("consumers-workload.monitor.oversubscribed", () -> monitorMetrics.oversubscribed);
}
origin: allegro/hermes

public void registerProducerInflightRequest(Gauge<Integer> gauge) {
  metricRegistry.register(metricRegistryName(Gauges.INFLIGHT_REQUESTS), gauge);
}
origin: allegro/hermes

public ByteBufferMessageBatchFactory(int poolableSize, int maxPoolSize, Clock clock, HermesMetrics hermesMetrics) {
  this.clock = clock;
  this.bufferPool = new DirectBufferPool(maxPoolSize, poolableSize, true);
  hermesMetrics.registerGauge(Gauges.BATCH_BUFFER_TOTAL_BYTES, bufferPool::totalMemory);
  hermesMetrics.registerGauge(Gauges.BATCH_BUFFER_AVAILABLE_BYTES, bufferPool::availableMemory);
}
origin: allegro/hermes

public MonitoredMpscQueue(HermesMetrics metrics, String name, int capacity) {
  this.queue = new MpscArrayQueue<>(capacity);
  this.name = name;
  this.metrics = metrics;
  metrics.registerGauge("queue." + name + ".utilization", () -> queue.size() / queue.capacity());
}
origin: pl.allegro.tech.hermes/hermes-consumers

public MonitoredMpscQueue(HermesMetrics metrics, String name, int capacity) {
  this.queue = new MpscArrayQueue<>(capacity);
  this.name = name;
  this.metrics = metrics;
  metrics.registerGauge("queue." + name + ".utilization", () -> queue.size() / queue.capacity());
}
pl.allegro.tech.hermes.common.metric

Most used classes

  • HermesMetrics
  • CounterStorage
  • ConsumerLatencyTimer$Context
  • ConsumerLatencyTimer
  • MetricsDeltaCalculator
    Small util to calculate delta between previous and current state of metric. It helps in developing i
  • ZookeeperCounterStorage,
  • InstrumentedExecutorServiceFactory,
  • StartedTimersPair,
  • CounterMatcher,
  • ZookeeperCounterReporter$CountersExceptOffsetsFilter,
  • ZookeeperCounterReporterTest,
  • InstrumentedExecutorService$InstrumentedCallable,
  • InstrumentedExecutorService$InstrumentedRunnable,
  • InstrumentedExecutorService,
  • InstrumentedScheduledExecutorService$InstrumentedPeriodicRunnable,
  • InstrumentedScheduledExecutorService
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now