/** * {@inheritDoc} */ public long getBytesWritten() { return myMetrics.bytesWritten.get(); }
/** * Push the metric to the mr. * The metric is pushed only if it was updated since last push * * Note this does NOT push to JMX * (JMX gets the info via {@link #get()} * * @param mr */ public synchronized void pushMetric(final MetricsRecord mr) { if (changed) mr.setMetric(getName(), value); changed = false; } }
/** * Report the original write timestamp of a SEP operation that was received. Assuming that SEP * operations are delivered in the same order as they are originally written in HBase (which * will always be the case except for when a region split or move takes place), this metric will always * hold the write timestamp of the most recent operation in HBase that has been handled by the SEP system. * * @param timestamp The write timestamp of the last SEP operation */ public void reportSepTimestamp(long writeTimestamp) { lastTimestampInputProcessed.set(writeTimestamp); }
public synchronized void setNumericMetric(String name, long amt) { MetricsLongValue m = (MetricsLongValue)registry.get(name); if (m == null) { m = new MetricsLongValue(name, this.registry); this.needsUpdateMessage = true; } m.set(amt); }
this.numAddCache.set(stats.numAdd); this.numAddNewCache.set(stats.numAddNew); this.numAddExistingCache.set(stats.numAddExisting); this.numRenameCache.set(stats.numRename); this.numRemoveCache.set(stats.numRemove); this.numEvictCache.set(stats.numEvict); this.numGetAttempts.set(stats.numGetAttempts); this.numGetHits.set(stats.numGetHits); this.numAddCache.pushMetric(this.metricsRecord); this.numAddNewCache.pushMetric(this.metricsRecord); this.numAddExistingCache.pushMetric(this.metricsRecord); this.numRenameCache.pushMetric(this.metricsRecord); this.numRemoveCache.pushMetric(this.metricsRecord); this.numEvictCache.pushMetric(this.metricsRecord); this.numGetAttempts.pushMetric(this.metricsRecord); this.numGetHits.pushMetric(this.metricsRecord);
Integer.valueOf(this.memstoreSizeMB.get())); sb = Strings.appendKeyValue(sb, "mbInMemoryWithoutWAL", Integer.valueOf(this.mbInMemoryWithoutWAL.get())); sb = Strings.appendKeyValue(sb, "numberOfPutsWithoutWAL", Long.valueOf(this.numPutsWithoutWAL.get())); sb = Strings.appendKeyValue(sb, "readRequestsCount", Long.valueOf(this.readRequestsCount.get())); sb = Strings.appendKeyValue(sb, "writeRequestsCount", Long.valueOf(this.writeRequestsCount.get())); sb = Strings.appendKeyValue(sb, "maxHeapMB", Long.valueOf(memory.getMax()/MB)); sb = Strings.appendKeyValue(sb, this.blockCacheSize.getName()+"MB", StringUtils.limitDecimalTo2((float)this.blockCacheSize.get()/MB)); sb = Strings.appendKeyValue(sb, this.blockCacheFree.getName()+"MB", StringUtils.limitDecimalTo2((float)this.blockCacheFree.get()/MB)); sb = Strings.appendKeyValue(sb, this.blockCacheCount.getName(), Long.valueOf(this.blockCacheCount.get())); sb = Strings.appendKeyValue(sb, this.blockCacheHitCount.getName(), Long.valueOf(this.blockCacheHitCount.get())); sb = Strings.appendKeyValue(sb, this.blockCacheMissCount.getName(), Long.valueOf(this.blockCacheMissCount.get())); sb = Strings.appendKeyValue(sb, this.blockCacheEvictedCount.getName(), Long.valueOf(this.blockCacheEvictedCount.get())); sb = Strings.appendKeyValue(sb, this.blockCacheHitRatio.getName(), Long.valueOf(this.blockCacheHitCachingRatio.get())+"%"); sb = Strings.appendKeyValue(sb, this.hdfsBlocksLocalityIndex.getName(), Long.valueOf(this.hdfsBlocksLocalityIndex.get()));
destFs.setReplication(dstat.getPath(), (short)destRepl); saved += HighTideNode.getMetrics().savedSize.get(); HighTideNode.getMetrics().savedSize.set(saved); srcFs.setReplication(sstat.getPath(), (short)srcRepl); saved += HighTideNode.getMetrics().savedSize.get(); HighTideNode.getMetrics().savedSize.set(saved);
public RepositoryMetrics(String recordName) { this.recordName = recordName; for (Action action : Action.values()) { rates.put(action, new MetricsTimeVaryingRate(action.name().toLowerCase(), registry)); } for (HBaseAction action : HBaseAction.values()) { hbaseRates.put(action, new MetricsTimeVaryingRate(action.name().toLowerCase(), registry)); } lastMutationEventTimestamp = new MetricsLongValue("timestampLastMutation", registry); context = MetricsUtil.getContext("repository"); metricsRecord = MetricsUtil.createRecord(context, recordName); context.registerUpdater(this); mbean = new RepositoryMetricsMXBean(this.registry); }
@Override public void doUpdates(MetricsContext metricsContext) { synchronized (this) { this.appliedOpsRate.pushMetric(this.metricsRecord); this.appliedBatchesRate.pushMetric(this.metricsRecord); this.ageOfLastAppliedOp.pushMetric(this.metricsRecord); } this.metricsRecord.update(); } }
this.memstoreSizeMB.pushMetric(this.metricsRecord); this.mbInMemoryWithoutWAL.pushMetric(this.metricsRecord); this.numPutsWithoutWAL.pushMetric(this.metricsRecord); this.readRequestsCount.pushMetric(this.metricsRecord); this.writeRequestsCount.pushMetric(this.metricsRecord); this.regions.pushMetric(this.metricsRecord); this.requests.pushMetric(this.metricsRecord); this.compactionQueueSize.pushMetric(this.metricsRecord); this.flushQueueSize.pushMetric(this.metricsRecord); this.blockCacheSize.pushMetric(this.metricsRecord); this.blockCacheFree.pushMetric(this.metricsRecord); this.blockCacheCount.pushMetric(this.metricsRecord); this.blockCacheHitCount.pushMetric(this.metricsRecord); this.blockCacheMissCount.pushMetric(this.metricsRecord); this.blockCacheEvictedCount.pushMetric(this.metricsRecord); this.blockCacheHitRatio.pushMetric(this.metricsRecord); this.blockCacheHitCachingRatio.pushMetric(this.metricsRecord); addHLogMetric(HLog.getSyncTime(), this.fsSyncLatency); addHLogMetric(HLog.getSlowAppendTime(), this.slowHLogAppendTime); this.slowHLogAppendCount.set(HLog.getSlowAppendCount()); this.checksumFailuresCount.set(HFile.getChecksumFailuresCount()); this.flushTime.pushMetric(this.metricsRecord); this.flushSize.pushMetric(this.metricsRecord); this.slowHLogAppendCount.pushMetric(this.metricsRecord); this.regionSplitSuccessCount.pushMetric(this.metricsRecord); this.regionSplitFailureCount.pushMetric(this.metricsRecord);
public SepMetrics(String recordName) { this.recordName = recordName; metricsRegistry = new MetricsRegistry(); sepProcessingRate = new MetricsTimeVaryingRate("sepProcessed", metricsRegistry); lastTimestampInputProcessed = new MetricsLongValue("lastSepTimestamp", metricsRegistry); context = MetricsUtil.getContext("repository"); metricsRecord = MetricsUtil.createRecord(context, recordName); context.registerUpdater(this); mbean = new SepMetricsMXBean(this.metricsRegistry); }
@Override public void doUpdates(MetricsContext metricsContext) { synchronized (this) { this.shippedOpsRate.pushMetric(this.metricsRecord); this.shippedBatchesRate.pushMetric(this.metricsRecord); this.logEditsReadRate.pushMetric(this.metricsRecord); this.logEditsFilteredRate.pushMetric(this.metricsRecord); this.ageOfLastShippedOp.pushMetric(this.metricsRecord); this.sizeOfLogQueue.pushMetric(this.metricsRecord); } this.metricsRecord.update(); } }
/** * @inheritDoc */ public long getBytesRead() { return myMetrics.bytesRead.get(); }
/** * Report the original write timestamp of a SEP operation that was received. Assuming that SEP * operations are delivered in the same order as they are originally written in HBase (which * will always be the case except for when a region split or move takes place), this metric will always * hold the write timestamp of the most recent operation in HBase that has been handled by the SEP system. * * @param timestamp The write timestamp of the last SEP operation */ public void reportSepTimestamp(long writeTimestamp) { lastTimestampInputProcessed.set(writeTimestamp); }
/** * Push the metric to the mr. * The metric is pushed only if it was updated since last push * * Note this does NOT push to JMX * (JMX gets the info via {@link #get()} * * @param mr */ public synchronized void pushMetric(final MetricsRecord mr) { if (changed) mr.setMetric(getName(), value); changed = false; } }
public SepMetrics(String recordName) { this.recordName = recordName; metricsRegistry = new MetricsRegistry(); sepProcessingRate = new MetricsTimeVaryingRate("sepProcessed", metricsRegistry); lastTimestampInputProcessed = new MetricsLongValue("lastSepTimestamp", metricsRegistry); context = MetricsUtil.getContext("repository"); metricsRecord = MetricsUtil.createRecord(context, recordName); context.registerUpdater(this); mbean = new SepMetricsMXBean(this.metricsRegistry); }
synchronized (this) { bytesWritten.pushMetric(metricsRecord); bytesRead.pushMetric(metricsRecord); blocksWritten.pushMetric(metricsRecord); blocksRead.pushMetric(metricsRecord);
return ((MetricsIntValue) o).get(); else if (o instanceof MetricsLongValue) return ((MetricsLongValue) o).get(); else if (o instanceof MetricsTimeVaryingInt) return ((MetricsTimeVaryingInt) o).getPreviousIntervalValue();
/** * Set the age of the last edit that was applied * @param timestamp write time of the edit */ public void setAgeOfLastAppliedOp(long timestamp) { ageOfLastAppliedOp.set(System.currentTimeMillis() - timestamp); } @Override
/** * Push the metric to the mr. * The metric is pushed only if it was updated since last push * * Note this does NOT push to JMX * (JMX gets the info via {@link #get()} * * @param mr */ public synchronized void pushMetric(final MetricsRecord mr) { if (changed) mr.setMetric(getName(), value); changed = false; } }