@Override
    public synchronized void getMetrics(MetricsCollector collector, boolean all) {
      long[] usageStats = getUsageStats();

      // start a new record
      MetricsRecordBuilder mrb = collector.addRecord(PolicyInformation.PolicyMetrics)
                                          .setContext("cache")
                                          .tag(MsInfo.ProcessName,
                                               MetricsUtils.METRICS_PROCESS_NAME)
                                          .tag(MsInfo.SessionId, session);

      // add the values to the new record
      mrb.addCounter(PolicyInformation.DataOnHeap,         usageStats[DATAONHEAP])
          .addCounter(PolicyInformation.DataOnList,        usageStats[DATAONLIST])
          .addCounter(PolicyInformation.MetaOnHeap,        usageStats[METAONHEAP])
          .addCounter(PolicyInformation.MetaOnList,        usageStats[METAONLIST])
          .addCounter(PolicyInformation.DataLocked,        usageStats[LOCKEDDATA])
          .addCounter(PolicyInformation.MetaLocked,        usageStats[LOCKEDMETA])
          .addCounter(PolicyInformation.HeapSize,          heapSize)
          .addCounter(PolicyInformation.HeapSizeMax,       maxHeapSize)
          .addCounter(PolicyInformation.ListSize,          usageStats[LISTSIZE])
          .addCounter(PolicyInformation.BPWrapperCount,    usageStats[BPWRAPCNT])
          .addCounter(PolicyInformation.BPWrapperDistinct, usageStats[BPWRAPDISTINCT])
          .addCounter(PolicyInformation.BPWrapperData,     usageStats[BPWRAPDATA])
          .addCounter(PolicyInformation.TotalData,         usageStats[DATAONHEAP]
                                                         + usageStats[DATAONLIST]
                                                         + usageStats[BPWRAPDATA])
          .addCounter(PolicyInformation.TotalMeta,         usageStats[METAONHEAP]
                                                         + usageStats[METAONLIST]
                                                         + usageStats[BPWRAPMETA]);
    }
Helper to get some basic LRFU usage statistics.
This method returns a long array with the following content:
- amount of data (bytes) on min-heap
- amount of data (bytes) on eviction short list
- amount of metadata (bytes) on min-heap
- amount of metadata (bytes) on eviction short list
- size of the eviction short list
- amount of locked bytes for data
- amount of locked bytes for metadata

@return long array with LRFU stats
llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelLrfuCachePolicy.java