<commit_before>package com.hubspot.singularity.s3uploader;

import java.util.Collection;
import java.util.concurrent.TimeUnit;

import com.codahale.metrics.Counter;
import com.codahale.metrics.Gauge;
import com.codahale.metrics.JmxReporter;
import com.codahale.metrics.Meter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class SingularityS3UploaderMetrics {

  private final MetricRegistry registry;
  private final Counter uploaderCounter;
  private final Counter uploadCounter;
  private final Counter immediateUploaderCounter;
  private final Counter errorCounter;
  private final Timer uploadTimer;
  private final Meter filesystemEventsMeter;

  private Optional<Collection<SingularityS3Uploader>> expiring;

  private long timeOfLastSuccessUpload;
  private int lastUploadDuration;
  private long startUploadsAt;

  @Inject
  public SingularityS3UploaderMetrics(MetricRegistry registry) {
    this.registry = registry;
    this.uploaderCounter = registry.counter(name("uploaders", "total"));
    this.immediateUploaderCounter = registry.counter(name("uploaders", "total"));<commit_msg>Rename metric for immediate uploaders<commit_after>package com.hubspot.singularity.s3uploader;

import java.util.Collection;
import java.util.concurrent.TimeUnit;

import com.codahale.metrics.Counter;
import com.codahale.metrics.Gauge;
import com.codahale.metrics.JmxReporter;
import com.codahale.metrics.Meter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class SingularityS3UploaderMetrics {

  private final MetricRegistry registry;
  private final Counter uploaderCounter;
  private final Counter uploadCounter;
  private final Counter immediateUploaderCounter;
  private final Counter errorCounter;
  private final Timer uploadTimer;
  private final Meter filesystemEventsMeter;

  private Optional<Collection<SingularityS3Uploader>> expiring;

  private long timeOfLastSuccessUpload;
  private int lastUploadDuration;
  private long startUploadsAt;

  @Inject
  public SingularityS3UploaderMetrics(MetricRegistry registry) {
    this.registry = registry;
    this.uploaderCounter = registry.counter(name("uploaders", "total"));
    this.immediateUploaderCounter = registry.counter(name("uploaders", "immediate"));
{'fraction_non_alphanumeric': 0.07971586424625099, 'fraction_numerical': 0.0031570639305445935, 'mean_word_length': 6.3478260869565215, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6083064', 'n_tokens_mistral': 728, 'n_tokens_neox': 711, 'n_words': 163}