/** * Constructor to create a UimaMonitor. The class and pipeline name should be specified so that we * can differentiate between them in the logging and metrics * * @param clazz The class that is creating the UimaMonitor instance * @param pipelineName The name of the pipeline */ public UimaMonitor(String pipelineName, Class<?> clazz) { this.pipelineName = pipelineName; logger = LoggerFactory.getLogger(UimaUtils.makePipelineSpecificName(pipelineName, clazz)); metrics = MetricsFactory.getMetrics(pipelineName, clazz); }
/** * Constructor to create a UimaMonitor. The class and pipeline name should be specified so that we * can differentiate between them in the logging and metrics * * @param clazz The class that is creating the UimaMonitor instance * @param pipelineName The name of the pipeline */ public UimaMonitor(String pipelineName, Class<?> clazz) { this.pipelineName = pipelineName; logger = LoggerFactory.getLogger(UimaUtils.makePipelineSpecificName(pipelineName, clazz)); metrics = MetricsFactory.getMetrics(pipelineName, clazz); }
/** * New instance. * * @param pipelineName the name of the pipeline * @param clazz the clazz to owning this support * @param history the history to store to (if null will use the Noop history) * @param monitor the monitor instance, used for logging. * @param mergeDistinctEntities when merging should we merge entities when they have distinct * reference targets */ public UimaSupport( String pipelineName, Class<?> clazz, BaleenHistory history, UimaMonitor monitor, boolean mergeDistinctEntities) { this.pipelineName = pipelineName; this.history = history != null ? history : NoopBaleenHistory.getInstance(); referrer = UimaUtils.makePipelineSpecificName(pipelineName, clazz); this.monitor = monitor; this.mergeDistinctEntities = mergeDistinctEntities; }
/** * New instance. * * @param pipelineName the name of the pipeline * @param clazz the clazz to owning this support * @param history the history to store to (if null will use the Noop history) * @param monitor the monitor instance, used for logging. * @param mergeDistinctEntities when merging should we merge entities when they have distinct * reference targets */ public UimaSupport( String pipelineName, Class<?> clazz, BaleenHistory history, UimaMonitor monitor, boolean mergeDistinctEntities) { this.pipelineName = pipelineName; this.history = history != null ? history : NoopBaleenHistory.getInstance(); referrer = UimaUtils.makePipelineSpecificName(pipelineName, clazz); this.monitor = monitor; this.mergeDistinctEntities = mergeDistinctEntities; }
@Test public void testMakePipelineSpecificName() { String name = UimaUtils.makePipelineSpecificName("abc", UimaUtilsTest.class); assertTrue(name.contains("abc")); assertTrue(name.contains(UimaUtilsTest.class.getSimpleName())); } }