/** * Creates the monitor. * * @param pipelineName the pipeline name * @return the uima monitor */ protected UimaMonitor createMonitor(final String pipelineName) { return new UimaMonitor(pipelineName, this.getClass()); }
protected UimaMonitor createMonitor(String pipelineName) { return new UimaMonitor(pipelineName, this.getClass()); }
/** * Create a monitor based on the pipeline name. * * @param pipelineName * @return monitor (non null) */ protected UimaMonitor createMonitor(String pipelineName) { return new UimaMonitor(pipelineName, this.getClass()); } }
/** * Create a monitor based on pipeline. * * @param pipelineName * @return monitor (non-null) */ protected UimaMonitor createMonitor(String pipelineName) { return new UimaMonitor(pipelineName, this.getClass()); } }
/** * Creates the monitor. * * @param pipelineName the pipeline name * @return the uima monitor */ protected UimaMonitor createMonitor(final String pipelineName) { return new UimaMonitor(pipelineName, this.getClass()); }
protected UimaMonitor createMonitor(String pipelineName) { return new UimaMonitor(pipelineName, this.getClass()); }
/** * Create a monitor based on pipeline. * * @param pipelineName * @return monitor (non-null) */ protected UimaMonitor createMonitor(String pipelineName) { return new UimaMonitor(pipelineName, this.getClass()); } }
/** * Create a monitor based on the pipeline name. * * @param pipelineName * @return monitor (non null) */ protected UimaMonitor createMonitor(String pipelineName) { return new UimaMonitor(pipelineName, this.getClass()); } }
protected UimaMonitor createMonitor(String pipelineName) { return new UimaMonitor(pipelineName, this.getClass()); }
private DocumentGraphFactory createfactory(DocumentGraphOptions options) { UimaMonitor monitor = new UimaMonitor("test", DocumentGraphFactoryTest.class); return new DocumentGraphFactory(monitor, options); }
private JsonJCasConverterBuilder createBuilder() throws UIMAException { final UimaMonitor monitor = new UimaMonitor("test", JsonJCasConverter.class); return new JsonJCasConverterBuilder(monitor); } }
private JsonJCasConverter createConverter( List<Class<? extends BaleenAnnotation>> whiteList, List<Class<? extends BaleenAnnotation>> blackList) { final UimaMonitor monitor = new UimaMonitor("test", JsonJCasConverter.class); return new JsonJCasConverter(monitor, whiteList, blackList); } }
@Override public final void initialize(final UimaContext context) throws ResourceInitializationException { // This will do initialization of resources, // but won't be included in the metrics super.initialize(context); final String pipelineName = UimaUtils.getPipelineName(context); monitor = new UimaMonitor(pipelineName, this.getClass()); getMonitor().startFunction("initialize"); // Pull the config parameters out for job settings config = BaleenScheduler.getConfigParameters(context); doInitialize(context); getMonitor().finishFunction("initialize"); }
@Override public final void initialize(final UimaContext context) throws ResourceInitializationException { // This will do initialization of resources, // but won't be included in the metrics super.initialize(context); final String pipelineName = UimaUtils.getPipelineName(context); monitor = new UimaMonitor(pipelineName, this.getClass()); getMonitor().startFunction("initialize"); // Pull the config parameters out for job settings config = BaleenScheduler.getConfigParameters(context); doInitialize(context); getMonitor().finishFunction("initialize"); }
public AnalysisMockData() { try { monitor = new UimaMonitor("test", this.getClass()); idGenerator = new SharedIdGenerator(); idGenerator.initialize(new AnalysisEngineDescription_impl(), Collections.emptyMap()); docId = toId(BALEEN_DOC_ID); createERC(); createJCas(); } catch (final Exception e) { throw new RuntimeException(e); } }
@Test public void testTiming() { UimaMonitor monitor = new UimaMonitor(PIPELINE, this.getClass()); monitor.startFunction(FUNCTION); try { Thread.sleep(100); } catch (InterruptedException e) { // Do nothing } monitor.finishFunction(FUNCTION); Metrics m = MetricsFactory.getMetrics(PIPELINE, this.getClass()); assertTrue(m.getTimer(FUNCTION).getSnapshot().getValues()[0] > 0); }
@Test public void testLogger() { UimaMonitor monitor = new UimaMonitor(PIPELINE, this.getClass()); monitor.trace("test"); monitor.debug("test"); monitor.info("test"); monitor.warn("test"); monitor.error("test"); } }
@Test public void testEntityAdded() { UimaMonitor monitor = new UimaMonitor(PIPELINE, this.getClass()); monitor.entityAdded(ENTITY_TYPE_1); monitor.entityAdded(ENTITY_TYPE_1); monitor.entityAdded(ENTITY_TYPE_2); monitor.entityAdded(ENTITY_TYPE_2); monitor.entityAdded(ENTITY_TYPE_1); monitor.persistCounts(); Metrics m = MetricsFactory.getMetrics(PIPELINE, this.getClass()); assertEquals(3, m.getCounter(ENTITY_TYPE_1 + "-added").getCount()); assertEquals(2, m.getCounter(ENTITY_TYPE_2 + "-added").getCount()); }
@Test public void testEntityRemoved() { UimaMonitor monitor = new UimaMonitor(PIPELINE, this.getClass()); monitor.entityRemoved(ENTITY_TYPE_1); monitor.entityRemoved(ENTITY_TYPE_1); monitor.entityRemoved(ENTITY_TYPE_2); monitor.entityRemoved(ENTITY_TYPE_2); monitor.entityRemoved(ENTITY_TYPE_1); monitor.persistCounts(); Metrics m = MetricsFactory.getMetrics(PIPELINE, this.getClass()); assertEquals(3, m.getCounter(ENTITY_TYPE_1 + "-removed").getCount()); assertEquals(2, m.getCounter(ENTITY_TYPE_2 + "-removed").getCount()); }
@Test public void testMetrics() { UimaMonitor monitor = new UimaMonitor(PIPELINE, this.getClass()); assertNotNull(monitor.counter("a")); assertNotNull(monitor.meter("b")); assertNotNull(monitor.histogram("c")); assertNotNull(monitor.timer("d")); }