Skip to content

Commit

Permalink
Add cache prunes/millis to caches tab (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiddlet2666 authored Dec 2, 2024
1 parent 909f903 commit 9cb9e05
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,8 @@ public String[] getMetadata()
Localization.getLocalText(LBL_NODE_ID), Localization.getLocalText(LBL_SIZE),
Localization.getLocalText(LBL_MEMORY_BYTES), Localization.getLocalText(LBL_TOTAL_GETS),
Localization.getLocalText(LBL_TOTAL_PUTS), Localization.getLocalText(LBL_CACHE_HITS),
Localization.getLocalText(LBL_CACHE_MISSES), Localization.getLocalText("LBL_hit_probability")
Localization.getLocalText(LBL_CACHE_MISSES), Localization.getLocalText("LBL_cache_prunes"),
Localization.getLocalText("LBL_cache_prunes_millis"), Localization.getLocalText("LBL_hit_probability")
};

/**
Expand All @@ -1512,6 +1513,7 @@ public String[] getMetadata()
Localization.getLocalText(LBL_NODE_ID), Localization.getLocalText(LBL_SIZE),
Localization.getLocalText(LBL_TOTAL_GETS), Localization.getLocalText(LBL_TOTAL_PUTS),
Localization.getLocalText(LBL_CACHE_HITS), Localization.getLocalText(LBL_CACHE_MISSES),
Localization.getLocalText("LBL_cache_prunes"), Localization.getLocalText("LBL_cache_prunes_millis"),
Localization.getLocalText("LBL_hit_probability")
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ public CoherenceCachePanel(VisualVMModel model)

RenderHelper.setColumnRenderer(f_tableDetail, CacheDetailData.CACHE_HITS, new RenderHelper.IntegerRenderer());
RenderHelper.setColumnRenderer(f_tableDetail, CacheDetailData.CACHE_MISSES, new RenderHelper.IntegerRenderer());
RenderHelper.setColumnRenderer(f_tableDetail, CacheDetailData.CACHE_PRUNES, new RenderHelper.IntegerRenderer());
RenderHelper.setColumnRenderer(f_tableDetail, CacheDetailData.CACHE_PRUNES_MILLIS, new RenderHelper.IntegerRenderer());
RenderHelper.setColumnRenderer(f_tableDetail, CacheDetailData.MEMORY_BYTES, new RenderHelper.IntegerRenderer());
RenderHelper.setColumnRenderer(f_tableDetail, CacheDetailData.TOTAL_GETS, new RenderHelper.IntegerRenderer());
RenderHelper.setColumnRenderer(f_tableDetail, CacheDetailData.TOTAL_PUTS, new RenderHelper.IntegerRenderer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public Data populateData(RequestSender requestSender, ObjectName objName)
AttributeList listAttr = requestSender.getAttributes(objName,
new String[]{ ATTR_SIZE, ATTR_UNITS, ATTR_UNIT_FACTOR, ATTR_CACHE_HITS,
ATTR_CACHE_MISSES, ATTR_TOTAL_GETS, ATTR_TOTAL_PUTS,
ATTR_HIT_PROBABILITY });
ATTR_HIT_PROBABILITY, ATTR_CACHE_PRUNES, ATTR_CACHE_PRUNES_MILLIS });

data.setColumn(CacheDetailData.NODE_ID, Integer.valueOf(objName.getKeyProperty("nodeId")));

Expand All @@ -164,6 +164,8 @@ public Data populateData(RequestSender requestSender, ObjectName objName)
data.setColumn(CacheDetailData.CACHE_MISSES, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_CACHE_MISSES)));
data.setColumn(CacheDetailData.TOTAL_GETS, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_TOTAL_GETS)));
data.setColumn(CacheDetailData.TOTAL_PUTS, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_TOTAL_PUTS)));
data.setColumn(CacheDetailData.CACHE_PRUNES, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_CACHE_PRUNES)));
data.setColumn(CacheDetailData.CACHE_PRUNES_MILLIS, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_CACHE_PRUNES_MILLIS)));
data.setColumn(CacheDetailData.HIT_PROBABILITY, Double.parseDouble(getAttributeValueAsString(listAttr, ATTR_HIT_PROBABILITY)));

return data;
Expand All @@ -186,7 +188,9 @@ public Data populateData(Object[] aoColumns)
data.setColumn(CacheDetailData.TOTAL_PUTS, Long.valueOf(getNumberValue(aoColumns[8].toString())));
data.setColumn(CacheDetailData.CACHE_HITS, Long.valueOf(getNumberValue(aoColumns[9].toString())));
data.setColumn(CacheDetailData.CACHE_MISSES, Integer.valueOf(getNumberValue(aoColumns[10].toString())));
data.setColumn(CacheDetailData.HIT_PROBABILITY, Float.valueOf(aoColumns[11].toString()));
data.setColumn(CacheDetailData.CACHE_PRUNES, Long.valueOf(getNumberValue(aoColumns[11].toString())));
data.setColumn(CacheDetailData.CACHE_PRUNES_MILLIS, Long.valueOf(getNumberValue(aoColumns[12].toString())));
data.setColumn(CacheDetailData.HIT_PROBABILITY, Float.valueOf(aoColumns[13].toString()));

return data;
}
Expand Down Expand Up @@ -278,6 +282,10 @@ public SortedMap<Object, Data> getAggregatedDataFromHttpQueryingInternal(
Long.valueOf(nodeCacheMember.get("cacheHits").asText()));
data.setColumn(CacheDetailData.CACHE_MISSES,
Integer.valueOf(nodeCacheMember.get("cacheMisses").asText()));
data.setColumn(CacheDetailData.CACHE_PRUNES,
Long.valueOf(nodeCacheMember.get("cachePrunes").asText()));
data.setColumn(CacheDetailData.CACHE_PRUNES_MILLIS,
Long.valueOf(nodeCacheMember.get("cachePrunesMillis").asText()));
data.setColumn(CacheDetailData.HIT_PROBABILITY,
Float.valueOf(nodeCacheMember.get("hitProbability").floatValue()));

Expand Down Expand Up @@ -344,10 +352,20 @@ public Data processReporterData(Object[] aoColumns, VisualVMModel model)
*/
public static final int CACHE_MISSES = 6;

/**
* Array index for cache prunes.
*/
public static final int CACHE_PRUNES = 7;

/**
* Array index for cache prunes millis.
*/
public static final int CACHE_PRUNES_MILLIS = 8;

/**
* Array index for hit probability.
*/
public static final int HIT_PROBABILITY = 7;
public static final int HIT_PROBABILITY = 9;

/**
* Report for cache details data;
Expand Down Expand Up @@ -439,4 +457,14 @@ public String getValue()
* JMX attribute name for Hit Probability.
*/
protected static final String ATTR_HIT_PROBABILITY = "HitProbability";

/**
* JMX attribute name for Cache Prunes.
*/
protected static final String ATTR_CACHE_PRUNES = "CachePrunes";

/**
* JMX attribute name for Cache Prunes Millis.
*/
protected static final String ATTR_CACHE_PRUNES_MILLIS = "CachePrunesMillis";
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -59,7 +59,7 @@ public Data populateData(RequestSender sender, ObjectName objName)
AttributeList listAttr = sender.getAttributes(objName,
new String[]{ ATTR_SIZE, ATTR_UNITS, ATTR_UNIT_FACTOR, ATTR_CACHE_HITS,
ATTR_CACHE_MISSES, ATTR_TOTAL_GETS, ATTR_TOTAL_PUTS,
ATTR_HIT_PROBABILITY });
ATTR_HIT_PROBABILITY, ATTR_CACHE_PRUNES, ATTR_CACHE_PRUNES_MILLIS });

data.setColumn(CacheFrontDetailData.NODE_ID, Integer.valueOf(objName.getKeyProperty("nodeId")));

Expand All @@ -68,6 +68,8 @@ public Data populateData(RequestSender sender, ObjectName objName)
data.setColumn(CacheFrontDetailData.CACHE_MISSES, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_CACHE_MISSES)));
data.setColumn(CacheFrontDetailData.TOTAL_GETS, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_TOTAL_GETS)));
data.setColumn(CacheFrontDetailData.TOTAL_PUTS, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_TOTAL_PUTS)));
data.setColumn(CacheFrontDetailData.CACHE_PRUNES, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_CACHE_PRUNES)));
data.setColumn(CacheFrontDetailData.CACHE_PRUNES_MILLIS, Long.parseLong(getAttributeValueAsString(listAttr, ATTR_CACHE_PRUNES_MILLIS)));
data.setColumn(CacheFrontDetailData.HIT_PROBABILITY, Double.parseDouble(getAttributeValueAsString(listAttr, ATTR_HIT_PROBABILITY)));

return data;
Expand All @@ -84,7 +86,9 @@ public Data populateData(Object[] aoColumns)
data.setColumn(CacheFrontDetailData.TOTAL_PUTS, Long.valueOf(getNumberValue(aoColumns[8].toString())));
data.setColumn(CacheFrontDetailData.CACHE_HITS, Long.valueOf(getNumberValue(aoColumns[9].toString())));
data.setColumn(CacheFrontDetailData.CACHE_MISSES, Integer.valueOf(getNumberValue(aoColumns[10].toString())));
data.setColumn(CacheFrontDetailData.HIT_PROBABILITY, Float.valueOf(aoColumns[11].toString()));
data.setColumn(CacheFrontDetailData.CACHE_PRUNES, Long.valueOf(getNumberValue(aoColumns[11].toString())));
data.setColumn(CacheFrontDetailData.CACHE_PRUNES_MILLIS, Long.valueOf(getNumberValue(aoColumns[12].toString())));
data.setColumn(CacheFrontDetailData.HIT_PROBABILITY, Float.valueOf(aoColumns[13].toString()));

return data;
}
Expand Down Expand Up @@ -123,8 +127,19 @@ public Data populateData(Object[] aoColumns)
*/
public static final int CACHE_MISSES = 5;

/**
* Array index for cache prunes.
*/
public static final int CACHE_PRUNES = 6;

/**
* Array index for cache prunes millis.
*/
public static final int CACHE_PRUNES_MILLIS = 7;

/**
* Array index for hit probability.
*/
public static final int HIT_PROBABILITY = 6;
public static final int HIT_PROBABILITY = 8;

}
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ LBL_view_cache=View Cache
LBL_total_gets=Total Gets
LBL_total_puts=Total Puts
LBL_cache_hits=Cache Hits
LBL_cache_prunes=Cache Prunes
LBL_cache_prunes_millis=Cache Prunes Millis
LBL_cache_misses=Cache Misses
LBL_hit_probability=Hit Probability
LBL_locks_granted=Locks Granted
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2020, 2024 Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -100,19 +100,27 @@
<name>CacheMisses</name>
</column>

<column id="CachePrunes">
<name>CachePrunes</name>
</column>

<column id="CachePrunesMillis">
<name>CachePrunesMillis</name>
</column>

<column id="HitProbability">
<name>HitProbability</name>
</column>

<column id="Units">
<name>Units</name>
<hidden>true</hidden>
</column>
<column id="Units">
<name>Units</name>
<hidden>true</hidden>
</column>

<column id="UnitFactor">
<name>UnitFactor</name>
<hidden>true</hidden>
</column>
<column id="UnitFactor">
<name>UnitFactor</name>
<hidden>true</hidden>
</column>
</row>
</report>
</report-config>

0 comments on commit 9cb9e05

Please sign in to comment.