metricsRecord = MetricsUtil.createRecord(metricsContext, "journalnode");
String journalId = journal.getJournalId();
metricsRecord.setTag("journalid", journalId);
metricsContext.registerUpdater(this);
batchesWrittenWhileLagging = new MetricsTimeVaryingLong(
"batchesWrittenWhileLagging_" + journalId, registry,
"batchesWrittenWhileLagging");
batchesWritten = new MetricsTimeVaryingLong("batchesWritten_" + journalId,
registry, "batchesWritten");
bytesWritten = new MetricsTimeVaryingLong("bytesWritten_" + journalId,
registry, "bytesWritten");
txnsWritten = new MetricsTimeVaryingLong("txnsWritten_" + journalId,
registry, "txnsWritten");
syncTime = new MetricsTimeVaryingRate("syncTimes_" + journalId, registry);
lastWriterEpoch = new MetricsLongValue("lastWriterEpoch_" + journalId,
registry);
lastPromisedEpoch = new MetricsLongValue("lastPromisedEpoch_" + journalId,
registry);
lastWrittenTxId = new MetricsLongValue("lastWrittenTxId_" + journalId,
registry);
currentTxnsLag = new MetricsLongValue("currentTxnsLag_" + journalId,
registry);
// http related metrics
numGetJournalDoGet = new MetricsTimeVaryingLong("numGetEditsServletDoGet_"
+ journalId, registry);
numGetImageDoGet = new MetricsTimeVaryingLong("numGetImageServletDoGet_"
+ journalId, registry);
sizeGetJournalDoGet = new MetricsTimeVaryingLong(
"numListPathsServletDoGet_" + journalId, registry);
LOG.info("Initializing JournalNodeMeterics using context object:"
+ metricsContext.getClass().getName());
}