/** * Calls main constructor with {@link NullMetrics}. */ public PixelDataThread(boolean performProcessing, SessionManager manager, Executor executor, PixelDataHandler handler, Principal principal, String uuid, int numThreads) { this(performProcessing, manager, executor, handler, principal, uuid, numThreads, new NullMetrics()); }
/** * @see com.codahale.metrics.Timer#time */ public Timer.Context time() { return new Context(t.time()); }
public FullTextIndexer(EventLogLoader ll, Metrics metrics) { super("FullTextIndexer", "index"); this.loader = ll; this.parserSession = new ParserSession(); this.batchTimer = metrics.timer(this, "batch"); this.completeSlow= metrics.histogram(this, "percentCompleteSlow"); this.completeFast = metrics.histogram(this, "percentCompleteFast"); }
public void addPriority(Entry entry) { entries.put(entry.objId, entry); priorityQ.add(entry); priorityCount.inc(); } }
public Counter counter(Object obj, String name) { return new DefaultCounter(registry.counter(MetricRegistry.name(obj.getClass(), name))); }
public Timer timer(Object obj, String name) { return new DefaultTimer(registry.timer(MetricRegistry.name(obj.getClass(), name))); }
public Snapshot getSnapshot() { return new DefaultSnapshot(this.h.getSnapshot()); }
public Histogram histogram(Object obj, String name) { return new DefaultHistogram(registry.histogram(MetricRegistry.name(obj.getClass(), name))); }
private void registerAll(String prefix, MetricSet metrics, MetricRegistry registry) { for (Map.Entry<String, Metric> entry : metrics.getMetrics().entrySet()) { String name = MetricRegistry.name(prefix, entry.getKey()); if (entry.getValue() instanceof MetricSet) { registerAll(name, (MetricSet) entry.getValue(), registry); } else { registry.register(name, entry.getValue()); } } } }
protected List<Object[]> lookup() { final Timer.Context ctx = lookupTime.time(); try { final long current = getCurrentId(); List<Object[]> rv = sql.getEventLogPartitions(types, actions, current, max); log.debug(String.format("objects found searching " + "from %s (max: %s): %s", current, max, rv.size())); return rv; } finally { ctx.stop(); } }
/** * Main constructor. No arguments can be null. */ public PixelDataThread(boolean performProcessing, SessionManager manager, Executor executor, PixelDataHandler handler, Principal principal, String uuid, int numThreads, Metrics metrics, ReadOnlyStatus readOnly) { super(manager, executor, handler, principal); this.performProcessing = performProcessing; this.uuid = uuid; this.numThreads = numThreads; this.batchTimer = metrics.timer(this, "batch"); this.readOnly = readOnly; }
public FullTextIndexer(EventLogLoader ll) { this(ll, new NullMetrics()); }
private void addRegular(Entry entry) { entries.put(entry.objId, entry); regularQ.add(entry); regularCount.inc(); }
/** * Uses default {@link Principal} for processing and a {@link NullMetrics} * instance. */ @Deprecated public PixelDataThread(SessionManager manager, Executor executor, PixelDataHandler handler, String uuid, int numThreads) { this(manager, executor, handler, DEFAULT_PRINCIPAL, uuid, numThreads, new NullMetrics()); }
public void fail(EventLogFailure failure) { WrappedEventLog wrapped = (WrappedEventLog) failure.log; failureQ.add(wrapped); wrapped.entry.fail(); failureCount.inc(); // Note: this will stay in the hash map to prevent future access. }
public EventLogQueue() { this(new NullMetrics(), DEFAULT_MAX, new String[]{Project.class.getName(), Dataset.class.getName(), Screen.class.getName(), Plate.class.getName(), Image.class.getName()}, new String[]{ "INSERT", "UPDATE", "REINDEX", "DELETE"}); }
/** * Return a wrapped version of {@link ome.services.eventlogs.EventLogQueue.Data#next()} which could possibly be * null. */ public EventLog next() { nextCount.inc(); return offer(data.next()); }
/** * Calculates {@link #performProcessing} based on the existence of the * "pixelDataTrigger" and passes all parameters to * {@link #PixelDataThread(boolean, SessionManager, Executor, PixelDataHandler, Principal, String, int) the main ctor} * passing a {@link NullMetrics} as necessary. */ @Deprecated public PixelDataThread(SessionManager manager, Executor executor, PixelDataHandler handler, Principal principal, String uuid, int numThreads) { this(executor.getContext().containsBean("pixelDataTrigger"), manager, executor, handler, principal, uuid, numThreads, new NullMetrics()); }