private void submitTrackingEvent(URI jobSpecURI, String jobSpecVersion, String operType) { GobblinTrackingEvent e = GobblinTrackingEvent.newBuilder() .setName(TRACKING_EVENT_NAME) .setNamespace(JobCatalog.class.getName()) .setMetadata(ImmutableMap.<String, String>builder() .put(GobblinMetricsKeys.OPERATION_TYPE_META, operType) .put(GobblinMetricsKeys.JOB_SPEC_URI_META, jobSpecURI.toString()) .put(GobblinMetricsKeys.JOB_SPEC_VERSION_META, jobSpecVersion) .build()) .build(); this.metricsContext.submitEvent(e); }
private void submitTrackingEvent(URI specSpecURI, String specSpecVersion, String operType) { GobblinTrackingEvent e = GobblinTrackingEvent.newBuilder() .setName(TRACKING_EVENT_NAME) .setNamespace(SpecCatalog.class.getName()) .setMetadata(ImmutableMap.<String, String>builder() .put(GobblinMetricsKeys.OPERATION_TYPE_META, operType) .put(GobblinMetricsKeys.SPEC_URI_META, specSpecURI.toString()) .put(GobblinMetricsKeys.SPEC_VERSION_META, specSpecVersion) .build()) .build(); this.metricsContext.submitEvent(e); }
private void submitUnfulfilledRequestEventsHelper(List<FileSet<CopyEntity>> fileSetList, String eventName) { for (FileSet<CopyEntity> fileSet : fileSetList) { GobblinTrackingEvent event = GobblinTrackingEvent.newBuilder().setName(eventName).setNamespace(CopySource.class.getName()).setMetadata( ImmutableMap.<String, String>builder() .put(ConfigurationKeys.DATASET_URN_KEY, fileSet.getDataset().getUrn()) .put(FILESET_TOTAL_ENTITIES, Integer.toString(fileSet.getTotalEntities())) .put(FILESET_TOTAL_SIZE_IN_BYTES, Long.toString(fileSet.getTotalSizeInBytes())) .put(FILESET_NAME, fileSet.getName()).build()).build(); this.metricContext.submitEvent(event); } }
private void submitTrackingEvent(URI jobSpecURI, String jobSpecVersion, String operType) { GobblinTrackingEvent e = GobblinTrackingEvent.newBuilder() .setName(TRACKING_EVENT_NAME) .setNamespace(JobCatalog.class.getName()) .setMetadata(ImmutableMap.<String, String>builder() .put(GobblinMetricsKeys.OPERATION_TYPE_META, operType) .put(GobblinMetricsKeys.JOB_SPEC_URI_META, jobSpecURI.toString()) .put(GobblinMetricsKeys.JOB_SPEC_VERSION_META, jobSpecVersion) .build()) .build(); this.metricsContext.submitEvent(e); }
private void submitUnfulfilledRequestEventsHelper(List<FileSet<CopyEntity>> fileSetList, String eventName) { for (FileSet<CopyEntity> fileSet : fileSetList) { GobblinTrackingEvent event = GobblinTrackingEvent.newBuilder().setName(eventName).setNamespace(CopySource.class.getName()).setMetadata( ImmutableMap.<String, String>builder() .put(ConfigurationKeys.DATASET_URN_KEY, fileSet.getDataset().getUrn()) .put(FILESET_TOTAL_ENTITIES, Integer.toString(fileSet.getTotalEntities())) .put(FILESET_TOTAL_SIZE_IN_BYTES, Long.toString(fileSet.getTotalSizeInBytes())) .put(FILESET_NAME, fileSet.getName()).build()).build(); this.metricContext.submitEvent(event); } }
private void submitTrackingEvent(URI specSpecURI, String specSpecVersion, String operType) { GobblinTrackingEvent e = GobblinTrackingEvent.newBuilder() .setName(TRACKING_EVENT_NAME) .setNamespace(SpecCatalog.class.getName()) .setMetadata(ImmutableMap.<String, String>builder() .put(GobblinMetricsKeys.OPERATION_TYPE_META, operType) .put(GobblinMetricsKeys.SPEC_URI_META, specSpecURI.toString()) .put(GobblinMetricsKeys.SPEC_VERSION_META, specSpecVersion) .build()) .build(); this.metricsContext.submitEvent(e); }
.setName(MultiPartEvent.JOBSTATE_EVENT.getEventName()) .setNamespace(NAMESPACE) .setMetadata(metadata).build());
.setName(MultiPartEvent.JOBSTATE_EVENT.getEventName()) .setNamespace(NAMESPACE) .setMetadata(metadata).build());
@Test public void testSimpleEvent() throws IOException { try ( MetricContext metricContext = MetricContext.builder(this.getClass().getCanonicalName() + ".testInfluxDBReporter1").build(); InfluxDBEventReporter influxEventReporter = getBuilder(metricContext).build();) { Map<String, String> metadata = Maps.newHashMap(); metadata.put(JobEvent.METADATA_JOB_ID, "job1"); metadata.put(TaskEvent.METADATA_TASK_ID, "task1"); metricContext.submitEvent(GobblinTrackingEvent.newBuilder() .setName(JobEvent.TASKS_SUBMITTED) .setNamespace(NAMESPACE) .setMetadata(metadata).build()); try { Thread.sleep(100); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } influxEventReporter.report(); try { Thread.sleep(100); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } TimestampedValue retrievedEvent = influxDB.getMetric( "gobblin.metrics.job1.task1.events.TasksSubmitted"); Assert.assertEquals(retrievedEvent.getValue(), "0.0"); Assert.assertTrue(retrievedEvent.getTimestamp() <= (System.currentTimeMillis())); } }
@Test public void testSimpleEvent() throws IOException { try ( MetricContext metricContext = MetricContext.builder(this.getClass().getCanonicalName() + ".testGraphiteReporter1").build(); GraphiteEventReporter graphiteEventReporter = getBuilder(metricContext).withEmitValueAsKey(false).build();) { Map<String, String> metadata = Maps.newHashMap(); metadata.put(JobEvent.METADATA_JOB_ID, "job1"); metadata.put(TaskEvent.METADATA_TASK_ID, "task1"); metricContext.submitEvent(GobblinTrackingEvent.newBuilder() .setName(JobEvent.TASKS_SUBMITTED) .setNamespace(NAMESPACE) .setMetadata(metadata).build()); try { Thread.sleep(100); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } graphiteEventReporter.report(); try { Thread.sleep(100); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } TimestampedValue retrievedEvent = graphiteSender.getMetric("gobblin.metrics.job1.task1.events.TasksSubmitted"); Assert.assertEquals(retrievedEvent.getValue(), "0"); Assert.assertTrue(retrievedEvent.getTimestamp() <= (System.currentTimeMillis() / 1000l)); } }