Codota Logo
MetricContext$Builder.build
Code IndexAdd Codota to your IDE (free)

How to use
build
method
in
gobblin.metrics.MetricContext$Builder

Best Java code snippets using gobblin.metrics.MetricContext$Builder.build (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: com.linkedin.gobblin/gobblin-runtime

public JobCatalogBase(Optional<Logger> log, Optional<MetricContext> parentMetricContext,
  boolean instrumentationEnabled) {
 this.log = log.isPresent() ? log.get() : LoggerFactory.getLogger(getClass());
 this.listeners = new JobCatalogListenersList(log);
 if (instrumentationEnabled) {
  MetricContext realParentCtx =
    parentMetricContext.or(Instrumented.getMetricContext(new gobblin.configuration.State(), getClass()));
  this.metricContext = realParentCtx.childBuilder(JobCatalog.class.getSimpleName()).build();
  this.metrics = new StandardMetrics(this);
 }
 else {
  this.metricContext = null;
  this.metrics = null;
 }
}
origin: com.linkedin.gobblin/gobblin-runtime

MetricContext realParentCtx =
  parentMetricContext.or(Instrumented.getMetricContext(new gobblin.configuration.State(), getClass()));
this.metricContext = realParentCtx.childBuilder(TopologyCatalog.class.getSimpleName()).build();
this.metrics = new SpecCatalog.StandardMetrics(this);
origin: com.linkedin.gobblin/gobblin-runtime

public MetricContext getDefaultMetricContext() {
 if (_gobblinEnv.isPresent()) {
  return _gobblinEnv.get().getMetricContext()
    .childBuilder(JobExecutionLauncher.class.getSimpleName()).build();
 }
 gobblin.configuration.State fakeState =
   new gobblin.configuration.State(getSysConfig().getConfigAsProperties());
 List<Tag<?>> tags = new ArrayList<>();
 MetricContext res = Instrumented.getMetricContext(fakeState, Launcher.class, tags);
 return res;
}
origin: com.linkedin.gobblin/gobblin-metrics-base

public ReporterExampleBase(ContextAwareScheduledReporter.Builder reporterBuilder, int tasks, long totalRecords) {
 this.executor = Executors.newFixedThreadPool(10);
 this.context = MetricContext.builder("Job")
   .addTag(new Tag<String>(JobEvent.METADATA_JOB_NAME, "ExampleJob"))
   .addTag(new Tag<String>(JobEvent.METADATA_JOB_ID, JOB_NAME + "_" + System.currentTimeMillis()))
   .build();
 this.reporterBuilder = reporterBuilder;
 this.tasks = tasks;
 this.totalRecords = totalRecords;
}
origin: com.linkedin.gobblin/gobblin-metrics

protected GobblinMetrics(String id, MetricContext parentContext, List<Tag<?>> tags) {
 this.id = id;
 this.metricContext = parentContext == null ? new MetricContext.Builder(id).addTags(tags).build()
   : parentContext.childBuilder(id).addTags(tags).build();
}
origin: com.linkedin.gobblin/gobblin-metrics-base

private void addTask(int taskIndex, CountDownLatch countDownLatch) {
 // Build the context of this task, which is a child of the job's context.
 // Tags of the job (parent) context will be inherited automatically.
 MetricContext taskContext = this.context.childBuilder("Task" + taskIndex)
   .addTag(new Tag<String>(TASK_ID_KEY, TASK_ID_PREFIX + taskIndex))
   .build();
 Task task = new Task(taskContext, taskIndex, this.totalRecords, countDownLatch);
 this.executor.execute(task);
}
origin: com.linkedin.gobblin/gobblin-metrics-base

public MetricsFileSystemInstrumentation(FileSystem underlying) {
 super(underlying);
 this.closer = Closer.create();
 this.metricContext = new MetricContext.Builder(underlying.getUri() + "_metrics").build();
 this.metricContext = this.closer.register(metricContext);
 this.listStatusTimer = this.metricContext.timer("listStatus");
 this.listFilesTimer = this.metricContext.timer("listFiles");
 this.globStatusTimer = this.metricContext.timer("globStatus");
 this.mkdirTimer = this.metricContext.timer("mkdirs");
 this.renameTimer = this.metricContext.timer("rename");
 this.deleteTimer = this.metricContext.timer("delete");
 this.createTimer = this.metricContext.timer("create");
 this.openTimer = this.metricContext.timer("open");
 this.setOwnerTimer = this.metricContext.timer("setOwner");
 this.getFileStatusTimer = this.metricContext.timer("getFileStatus");
 this.setPermissionTimer = this.metricContext.timer("setPermission");
 this.setTimesTimer = this.metricContext.timer("setTimes");
 this.appendTimer = this.metricContext.timer ("append");
 this.concatTimer = this.metricContext.timer ("concat");
 this.allTimers = ImmutableList.<ContextAwareTimer>builder().add(
   this.listStatusTimer, this.listFilesTimer, this.globStatusTimer, this.mkdirTimer, this.renameTimer,
   this.deleteTimer, this.createTimer, this.openTimer, this.setOwnerTimer, this.getFileStatusTimer, this.setPermissionTimer,
   this.setTimesTimer, this.appendTimer, this.concatTimer
 ).build();
}
origin: com.linkedin.gobblin/gobblin-metrics

  ? gobblinMetrics.get().getMetricContext().childBuilder(klazz.getCanonicalName() + "." + randomId)
  : MetricContext.builder(klazz.getCanonicalName() + "." + randomId);
return builder.addTags(generatedTags).addTags(tags).build();
origin: com.linkedin.gobblin/gobblin-runtime

MetricContext realParentCtx =
  parentMetricContext.or(Instrumented.getMetricContext(new gobblin.configuration.State(), getClass()));
this.metricContext = realParentCtx.childBuilder(FlowCatalog.class.getSimpleName()).build();
this.metrics = new StandardMetrics(this);
origin: com.linkedin.gobblin/gobblin-metrics-base

   builder.addTag(new Tag<>(entry.getKey(), entry.getValue()));
  return new ResourceInstance<>(builder.build());
 return new ResourceInstance<>(builder.build());
} catch (NoSuchScopeException nsse) {
 throw new RuntimeException("Could not create MetricContext.", nsse);
gobblin.metricsMetricContext$Builderbuild

Javadoc

Builder a new MetricContext.

See Taggable#metricNamePrefix(boolean) for the semantic of includeTagKeys.

Note this builder may change the name of the built MetricContext if the parent context already has a child with that name. If this is unacceptable, use #buildStrict instead.

Popular methods of MetricContext$Builder

  • <init>
  • addTag
    Add a single Tag.
  • addTags
    Add a collection of Tags.
  • buildStrict
    Builder a new MetricContext. See Taggable#metricNamePrefix(boolean) for the semantic of includeTagKe

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • setContentView (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JCheckBox (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now