/** * 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 EventLogQueue(Metrics metrics, int max, String[] types, String[] actions) { this.lookupTime = metrics.timer(this, "lookupTime"); this.processTime = metrics.timer(this, "processTime"); this.nextCount = metrics.counter(this, "nextCount"); this.priorityCount = metrics.counter(this, "priorityCount"); this.regularCount = metrics.counter(this, "regularCount"); this.failureCount = metrics.counter(this, "failureCount"); // Rough testing shows each entry in the queue to take up about // 100 bytes of storage. If the max would use "too much memory", // then scale it down by 10%. E.g. the default would use ~100MB, // if this is more than 25% of memory, scale down. long memory = Runtime.getRuntime().maxMemory(); long queueBytes = max * 100; if (queueBytes > (.25 * memory)) { this.max = max/10; log.warn("max_partition_size set to more than 25% of " + "total heap size. Reducing by 1/10th to {}", this.max); } else { this.max = max; } this.types = Arrays.asList(types); this.actions = Arrays.asList(actions); this.data = new Data(priorityCount, regularCount, failureCount, this.types); }
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"); }