001 /*
002 * Copyright 2011-2015 UnboundID Corp.
003 * All Rights Reserved.
004 */
005 /*
006 * Copyright (C) 2015 UnboundID Corp.
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021 package com.unboundid.ldap.sdk.unboundidds.monitors;
022
023
024
025 import java.util.Collections;
026 import java.util.LinkedHashMap;
027 import java.util.Map;
028
029 import com.unboundid.ldap.sdk.Entry;
030 import com.unboundid.util.NotMutable;
031 import com.unboundid.util.ThreadSafety;
032 import com.unboundid.util.ThreadSafetyLevel;
033
034 import static com.unboundid.ldap.sdk.unboundidds.monitors.MonitorMessages.*;
035
036
037
038 /**
039 * <BLOCKQUOTE>
040 * <B>NOTE:</B> This class is part of the Commercial Edition of the UnboundID
041 * LDAP SDK for Java. It is not available for use in applications that
042 * include only the Standard Edition of the LDAP SDK, and is not supported for
043 * use in conjunction with non-UnboundID products.
044 * </BLOCKQUOTE>
045 * This class defines a monitor entry that provides information about the sate
046 * of a FIFO entry cache in the Directory Server. The information that may be
047 * available about the entry cache includes:
048 * <UL>
049 * <LI>The name assigned to the cache.</LI>
050 * <LI>The number of attempts (successful and total) and the hit ratio when
051 * trying to retrieve an entry from the cache.</LI>
052 * <LI>The maximum allowed size of the entry cache in entries and bytes.</LI>
053 * <LI>The number of entries currently held in the cache.</LI>
054 * <LI>The number of entries added to or updated in the cache.</LI>
055 * <LI>The number of times an entry was not added to the cache because it was
056 * already present.</LI>
057 * <LI>The number of times an entry was not added to the cache because it did
058 * not match filter criteria required for inclusion.</LI>
059 * <LI>The number of times an entry was not added to the cache because it was
060 * too small to be included.</LI>
061 * <LI>The number of times an entry was evicted because of memory pressure or
062 * to make room for new entries.</LI>
063 * <LI>Information about the current memory consumption of the cache and
064 * whether the cache is currently full.</LI>
065 * </UL>
066 * The server will automatically present one monitor entry for every FIFO entry
067 * cache defined in the server. It is possible to have multiple caches enabled
068 * if desired (e.g., one specifically targeting large static groups, and another
069 * small cache to help improve write-after-read performance). FIFO entry cache
070 * monitor entries can be retrieved using the
071 * {@link MonitorManager#getFIFOEntryCacheMonitorEntries} method. These monitor
072 * entries provide specific methods for accessing information about the FIFO
073 * entry cache. Alternately, this information may be accessed using the generic
074 * API. See the {@link MonitorManager} class documentation for an example that
075 * demonstrates the use of the generic API for accessing monitor data.
076 */
077 @NotMutable()
078 @ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
079 public final class FIFOEntryCacheMonitorEntry
080 extends MonitorEntry
081 {
082 /**
083 * The structural object class used in entry cache monitor entries.
084 */
085 static final String FIFO_ENTRY_CACHE_MONITOR_OC =
086 "ds-fifo-entry-cache-monitor-entry";
087
088
089
090 /**
091 * The name of the attribute that holds the name of the associated FIFO entry
092 * cache.
093 */
094 private static final String ATTR_CACHE_NAME = "cacheName";
095
096
097
098 /**
099 * The name of the attribute that holds the number of cache hits.
100 */
101 private static final String ATTR_ENTRY_CACHE_HITS = "entryCacheHits";
102
103
104
105 /**
106 * The name of the attribute that holds the number of cache tries.
107 */
108 private static final String ATTR_ENTRY_CACHE_TRIES = "entryCacheTries";
109
110
111
112 /**
113 * The name of the attribute that holds the cache hit ratio.
114 */
115 private static final String ATTR_ENTRY_CACHE_HIT_RATIO = "entryCacheHitRatio";
116
117
118
119 /**
120 * The name of the attribute that holds the maximum cache size in bytes.
121 */
122 private static final String ATTR_MAX_ENTRY_CACHE_SIZE = "maxEntryCacheSize";
123
124
125
126 /**
127 * The name of the attribute that holds the number of entries currently in the
128 * cache.
129 */
130 private static final String ATTR_CURRENT_ENTRY_CACHE_COUNT =
131 "currentEntryCacheCount";
132
133
134
135 /**
136 * The name of the attribute that holds the maximum number of entries that may
137 * be held in the cache.
138 */
139 private static final String ATTR_MAX_ENTRY_CACHE_COUNT = "maxEntryCacheCount";
140
141
142
143 /**
144 * The name of the attribute that holds the number of entries added to or
145 * replaced in the cache.
146 */
147 private static final String ATTR_ENTRIES_ADDED_OR_UPDATED =
148 "entriesAddedOrUpdated";
149
150
151
152 /**
153 * The name of the attribute that holds the number of entries evicted because
154 * the entry cache had reached its maximum memory allocation.
155 */
156 private static final String ATTR_EVICTIONS_DUE_TO_MAX_MEMORY =
157 "evictionsDueToMaxMemory";
158
159
160
161 /**
162 * The name of the attribute that holds the number of entries evicted because
163 * the entry cache had reached its maximum entry count.
164 */
165 private static final String ATTR_EVICTIONS_DUE_TO_MAX_ENTRIES =
166 "evictionsDueToMaxEntries";
167
168
169
170 /**
171 * The name of the attribute that holds the number of entries that were not
172 * added because they were already present in the cache.
173 */
174 private static final String ATTR_ENTRIES_NOT_ADDED_ALREADY_PRESENT =
175 "entriesNotAddedAlreadyPresent";
176
177
178
179 /**
180 * The name of the attribute that holds the number of entries that were not
181 * added because the cache had reached its maximum memory allocation.
182 */
183 private static final String ATTR_ENTRIES_NOT_ADDED_DUE_TO_MAX_MEMORY =
184 "entriesNotAddedDueToMaxMemory";
185
186
187
188 /**
189 * The name of the attribute that holds the number of entries that were not
190 * added because they did not meet the necessary filter criteria.
191 */
192 private static final String ATTR_ENTRIES_NOT_ADDED_DUE_TO_FILTER =
193 "entriesNotAddedDueToFilter";
194
195
196
197 /**
198 * The name of the attribute that holds the number of entries that were not
199 * added because they did not have enough values to be considered for
200 * inclusion in the cache.
201 */
202 private static final String ATTR_ENTRIES_NOT_ADDED_DUE_TO_ENTRY_SMALLNESS =
203 "entriesNotAddedDueToEntrySmallness";
204
205
206
207 /**
208 * The name of the attribute that holds the number of times that entries were
209 * purged from the cache because the JVM was running low on memory.
210 */
211 private static final String ATTR_LOW_MEMORY_OCCURRENCES =
212 "lowMemoryOccurrences";
213
214
215
216 /**
217 * The name of the attribute that holds the percentage of the maximum allowed
218 * number of entries that are currently held in the cache.
219 */
220 private static final String ATTR_PERCENT_FULL_MAX_ENTRIES =
221 "percentFullMaxEntries";
222
223
224
225 /**
226 * The name of the attribute that holds the maximum percent of JVM memory that
227 * may be consumed before entries may stop being added to the cache.
228 */
229 private static final String ATTR_JVM_MEMORY_MAX_PERCENT_THRESHOLD =
230 "jvmMemoryMaxPercentThreshold";
231
232
233
234 /**
235 * The name of the attribute that holds the percent of JVM memory that is
236 * currently consumed.
237 */
238 private static final String ATTR_JVM_MEMORY_CURRENT_PERCENT_FULL =
239 "jvmMemoryCurrentPercentFull";
240
241
242
243 /**
244 * The name of the attribute that holds the difference between the maximum
245 * memory percent threshold and the current percent full.
246 */
247 private static final String ATTR_JVM_MEMORY_BELOW_MAX_MEMORY_PERCENT =
248 "jvmMemoryBelowMaxMemoryPercent";
249
250
251
252 /**
253 * The name of the attribute that indicates whether the entry cache is
254 * currently full (based on memory usage or number of entries).
255 */
256 private static final String ATTR_IS_FULL = "isFull";
257
258
259
260 /**
261 * The name of the attribute that holds a human-readable message about the
262 * capacity and utilization of the cache.
263 */
264 private static final String ATTR_CAPACITY_DETAILS = "capacityDetails";
265
266
267
268 /**
269 * The serial version UID for this serializable class.
270 */
271 private static final long serialVersionUID = -3340643698412829407L;
272
273
274
275 // The value of the isFull attribute.
276 private final Boolean isFull;
277
278 // The value of the currentEntryCacheCount attribute.
279 private final Long currentEntryCacheCount;
280
281 // The value of the entriesAddedOrUpdated attribute.
282 private final Long entriesAddedOrUpdated;
283
284 // The value of the entriesNotAddedAlreadyPresent attribute.
285 private final Long entriesNotAddedAlreadyPresent;
286
287 // The value of the entriesNotAddedDueToEntrySmallness attribute.
288 private final Long entriesNotAddedDueToEntrySmallness;
289
290 // The value of the entriesNotAddedDueToFilter attribute.
291 private final Long entriesNotAddedDueToFilter;
292
293 // The value of the entriesNotAddedDueToMaxMemory attribute.
294 private final Long entriesNotAddedDueToMaxMemory;
295
296 // The value of the entryCacheHitRatio attribute.
297 private final Long entryCacheHitRatio;
298
299 // The value of the entryCacheHits attribute.
300 private final Long entryCacheHits;
301
302 // The value of the entryCacheTries attribute.
303 private final Long entryCacheTries;
304
305 // The value of the evictionsDueToMaxEntries attribute.
306 private final Long evictionsDueToMaxEntries;
307
308 // The value of the evictionsDueToMaxMemory attribute.
309 private final Long evictionsDueToMaxMemory;
310
311 // The value of the jvmMemoryBelowMaxMemoryPercent attribute.
312 private final Long jvmMemoryBelowMaxMemoryPercent;
313
314 // The value of the jvmMemoryCurrentPercentFull attribute.
315 private final Long jvmMemoryCurrentPercentFull;
316
317 // The value of the jvmMemoryMaxPercentThreshold attribute.
318 private final Long jvmMemoryMaxPercentThreshold;
319
320 // The value of the lowMemoryOccurrences attribute.
321 private final Long lowMemoryOccurrences;
322
323 // The value of the maxEntryCacheCount attribute.
324 private final Long maxEntryCacheCount;
325
326 // The value of the maxEntryCacheSize attribute.
327 private final Long maxEntryCacheSize;
328
329 // The value of the percentFullMaxEntries attribute.
330 private final Long percentFullMaxEntries;
331
332 // The value of the cacheName attribute.
333 private final String cacheName;
334
335 // The value of the capacityDetails attribute.
336 private final String capacityDetails;
337
338
339
340 /**
341 * Creates a new FIFO entry cache monitor entry from the provided entry.
342 *
343 * @param entry The entry to be parsed as a FIFO entry cache monitor entry.
344 * It must not be {@code null}.
345 */
346 public FIFOEntryCacheMonitorEntry(final Entry entry)
347 {
348 super(entry);
349
350 isFull = getBoolean(ATTR_IS_FULL);
351 currentEntryCacheCount = getLong(ATTR_CURRENT_ENTRY_CACHE_COUNT);
352 entriesAddedOrUpdated = getLong(ATTR_ENTRIES_ADDED_OR_UPDATED);
353 entriesNotAddedAlreadyPresent =
354 getLong(ATTR_ENTRIES_NOT_ADDED_ALREADY_PRESENT);
355 entriesNotAddedDueToEntrySmallness =
356 getLong(ATTR_ENTRIES_NOT_ADDED_DUE_TO_ENTRY_SMALLNESS);
357 entriesNotAddedDueToFilter = getLong(ATTR_ENTRIES_NOT_ADDED_DUE_TO_FILTER);
358 entriesNotAddedDueToMaxMemory =
359 getLong(ATTR_ENTRIES_NOT_ADDED_DUE_TO_MAX_MEMORY);
360 entryCacheHitRatio = getLong(ATTR_ENTRY_CACHE_HIT_RATIO);
361 entryCacheHits = getLong(ATTR_ENTRY_CACHE_HITS);
362 entryCacheTries = getLong(ATTR_ENTRY_CACHE_TRIES);
363 evictionsDueToMaxEntries = getLong(ATTR_EVICTIONS_DUE_TO_MAX_ENTRIES);
364 evictionsDueToMaxMemory = getLong(ATTR_EVICTIONS_DUE_TO_MAX_MEMORY);
365 jvmMemoryBelowMaxMemoryPercent =
366 getLong(ATTR_JVM_MEMORY_BELOW_MAX_MEMORY_PERCENT);
367 jvmMemoryCurrentPercentFull = getLong(ATTR_JVM_MEMORY_CURRENT_PERCENT_FULL);
368 jvmMemoryMaxPercentThreshold =
369 getLong(ATTR_JVM_MEMORY_MAX_PERCENT_THRESHOLD);
370 lowMemoryOccurrences = getLong(ATTR_LOW_MEMORY_OCCURRENCES);
371 maxEntryCacheCount = getLong(ATTR_MAX_ENTRY_CACHE_COUNT);
372 maxEntryCacheSize = getLong(ATTR_MAX_ENTRY_CACHE_SIZE);
373 percentFullMaxEntries = getLong(ATTR_PERCENT_FULL_MAX_ENTRIES);
374 cacheName = getString(ATTR_CACHE_NAME);
375 capacityDetails = getString(ATTR_CAPACITY_DETAILS);
376 }
377
378
379
380 /**
381 * Retrieves the name of the associated FIFO entry cache.
382 *
383 * @return The name of the associated FIFO entry cache, or {@code null} if
384 * this was not included in the monitor entry.
385 */
386 public String getCacheName()
387 {
388 return cacheName;
389 }
390
391
392
393 /**
394 * Retrieves the number of times that a requested entry was successfully found
395 * in the cache.
396 *
397 * @return The number of times that a requested entry was successfully found
398 * in the cache, or {@code null} if this was not included in the
399 * monitor entry.
400 */
401 public Long getEntryCacheHits()
402 {
403 return entryCacheHits;
404 }
405
406
407
408 /**
409 * Retrieves the number of times that an attempt was made to retrieve an entry
410 * from the cache.
411 *
412 * @return The number of times that an attempt was made to retrieve an entry
413 * from the cache, or {@code null} if this was not included in the
414 * monitor entry.
415 */
416 public Long getEntryCacheTries()
417 {
418 return entryCacheTries;
419 }
420
421
422
423 /**
424 * Retrieves the percentage of the time that a requested entry was
425 * successfully retrieved from the cache.
426 *
427 * @return The percentage of the time that a requested entry was successfully
428 * retrieved from the cache, or {@code null} if this was not included
429 * in the monitor entry.
430 */
431 public Long getEntryCacheHitRatio()
432 {
433 return entryCacheHitRatio;
434 }
435
436
437
438 /**
439 * Retrieves the maximum amount of memory (in bytes) that the entry cache may
440 * consume.
441 *
442 * @return The maximum amount of memory (in bytes) that the entry cache may
443 * consume, or {@code null} if this was not included in the monitor
444 * entry.
445 */
446 public Long getMaxEntryCacheSizeBytes()
447 {
448 return maxEntryCacheSize;
449 }
450
451
452
453 /**
454 * Retrieves the number of entries currently held in the entry cache.
455 *
456 * @return The number of entries currently held in the entry cache, or
457 * {@code null} if this was not included in the monitor entry.
458 */
459 public Long getCurrentEntryCacheCount()
460 {
461 return currentEntryCacheCount;
462 }
463
464
465
466 /**
467 * Retrieves the maximum number of entries that may be held in the entry
468 * cache.
469 *
470 * @return The maximum number of entries that may be held in the entry cache,
471 * or {@code null} if this was not included in the monitor entry.
472 */
473 public Long getMaxEntryCacheCount()
474 {
475 return maxEntryCacheCount;
476 }
477
478
479
480 /**
481 * Retrieves the total number of entries that have been added to or updated
482 * in the cache since it was enabled.
483 *
484 * @return The total number of entries that have been added to or updated in
485 * the cache since it was enabled, or {@code null} if this was not
486 * included in the monitor entry.
487 */
488 public Long getEntriesAddedOrUpdated()
489 {
490 return entriesAddedOrUpdated;
491 }
492
493
494
495 /**
496 * Retrieves the number of times that an entry has been evicted from the cache
497 * because the maximum memory consumption had been reached.
498 *
499 * @return The number of times that an entry has been evicted from the cache
500 * because the maximum memory consumption had been reached, or
501 * {@code null} if this was not included in the monitor entry.
502 */
503 public Long getEvictionsDueToMaxMemory()
504 {
505 return evictionsDueToMaxMemory;
506 }
507
508
509
510 /**
511 * Retrieves the maximum number of times that an entry has been evicted from
512 * the cache because it already contained the maximum number of entries.
513 *
514 * @return The maximum number of times that an entry has been evicted from
515 * the cache because it already contained the maximum number of
516 * entries, or {@code null} if this was not included in the monitor
517 * entry.
518 */
519 public Long getEvictionsDueToMaxEntries()
520 {
521 return evictionsDueToMaxEntries;
522 }
523
524
525
526 /**
527 * Retrieves the number of times that an entry was not added to the cache
528 * because it was already present.
529 *
530 * @return The number of times that an entry was not added to the cache
531 * because it was already present, or {@code null} if this was not
532 * included in the monitor entry.
533 */
534 public Long getEntriesNotAddedAlreadyPresent()
535 {
536 return entriesNotAddedAlreadyPresent;
537 }
538
539
540
541 /**
542 * Retrieves the number of times that an entry was not added to the cache
543 * because it was already at its maximum memory consumption.
544 *
545 * @return The number of times that an entry was not added to the cache
546 * because it was already at its maximum memory consumption, or
547 * {@code null} if this was not included in the monitor entry.
548 */
549 public Long getEntriesNotAddedDueToMaxMemory()
550 {
551 return entriesNotAddedDueToMaxMemory;
552 }
553
554
555
556 /**
557 * Retrieves the number of times that an entry was not added to the cache
558 * because it did not match the filter criteria for including it.
559 *
560 * @return The number of times that an entry was not added to the cache
561 * because it did not match the filter criteria for including it, or
562 * {@code null} if this was not included in the monitor entry.
563 */
564 public Long getEntriesNotAddedDueToFilter()
565 {
566 return entriesNotAddedDueToFilter;
567 }
568
569
570
571 /**
572 * Retrieves the number of times that an entry was not added to the cache
573 * because it did not have enough values to be considered for inclusion.
574 *
575 * @return The number of times that an entry was not added to the cache
576 * because it did not have enough values to be considered for
577 * inclusion, or {@code null} if this was not included in the monitor
578 * entry.
579 */
580 public Long getEntriesNotAddedDueToEntrySmallness()
581 {
582 return entriesNotAddedDueToEntrySmallness;
583 }
584
585
586
587 /**
588 * Retrieves the number of times that entries had to be evicted from the
589 * cache because the available JVM memory became critically low.
590 *
591 * @return The number of times that entries had to be evicted from the cache
592 * because the available JVM memory had become critically low, or
593 * {@code null} if this was not included in the monitor entry.
594 */
595 public Long getLowMemoryOccurrences()
596 {
597 return lowMemoryOccurrences;
598 }
599
600
601
602 /**
603 * Retrieves the percentage of the maximum allowed number of entries that are
604 * currently held in the cache.
605 *
606 * @return The percentage of the maximum allowed number of entries that are
607 * currently held in the cache, or {@code null} if this was not
608 * included in the monitor entry.
609 */
610 public Long getPercentFullMaxEntries()
611 {
612 return percentFullMaxEntries;
613 }
614
615
616
617 /**
618 * Retrieves the maximum percent of JVM memory that may be consumed in order
619 * for new entries to be added to the cache.
620 *
621 * @return The maximum percent of JVM memory that may be consumed in order
622 * for new entries to be added to the cache, or {@code null} if this
623 * was not included in the monitor entry.
624 */
625 public Long getJVMMemoryMaxPercentThreshold()
626 {
627 return jvmMemoryMaxPercentThreshold;
628 }
629
630
631
632 /**
633 * Retrieves the percentage of JVM memory that is currently being consumed.
634 *
635 * @return The percentage of JVM memory that is currently being consumed, or
636 * {@code null} if this was not included in the monitor entry.
637 */
638 public Long getJVMMemoryCurrentPercentFull()
639 {
640 return jvmMemoryCurrentPercentFull;
641 }
642
643
644
645 /**
646 * Retrieves the difference between the JVM max memory percent threshold and
647 * the JVM memory current percent full. Note that this value may be negative
648 * if the JVM is currently consuming more memory than the maximum threshold.
649 *
650 * @return The difference between the JVM max memory percent threshold and
651 * the JVM memory current percent full, or {@code null} if this was
652 * not included in the monitor entry.
653 */
654 public Long getJVMMemoryBelowMaxMemoryPercent()
655 {
656 return jvmMemoryBelowMaxMemoryPercent;
657 }
658
659
660
661 /**
662 * Indicates whether the entry cache is currently full, whether due to the
663 * maximum JVM memory consumption or the maximum number of entries allowed in
664 * the cache.
665 *
666 * @return {@code Boolean.TRUE} if the entry cache is currently full,
667 * {@code Boolean.FALSE} if the entry cache is not yet full, or
668 * {@code null} if this was not included in the monitor entry.
669 */
670 public Boolean isFull()
671 {
672 return isFull;
673 }
674
675
676
677 /**
678 * Retrieves a human-readable message about the capacity and utilization of
679 * the entry cache.
680 *
681 * @return A human-readable message about the capacity and utilization of the
682 * entry cache, or {@code null} if this was not included in the
683 * monitor entry.
684 */
685 public String getCapacityDetails()
686 {
687 return capacityDetails;
688 }
689
690
691
692 /**
693 * {@inheritDoc}
694 */
695 @Override()
696 public String getMonitorDisplayName()
697 {
698 return INFO_FIFO_ENTRY_CACHE_MONITOR_DISPNAME.get();
699 }
700
701
702
703 /**
704 * {@inheritDoc}
705 */
706 @Override()
707 public String getMonitorDescription()
708 {
709 return INFO_FIFO_ENTRY_CACHE_MONITOR_DESC.get();
710 }
711
712
713
714 /**
715 * {@inheritDoc}
716 */
717 @Override()
718 public Map<String,MonitorAttribute> getMonitorAttributes()
719 {
720 final LinkedHashMap<String,MonitorAttribute> attrs =
721 new LinkedHashMap<String,MonitorAttribute>(30);
722
723 if (cacheName != null)
724 {
725 addMonitorAttribute(attrs,
726 ATTR_CACHE_NAME,
727 INFO_FIFO_ENTRY_CACHE_DISPNAME_CACHE_NAME.get(),
728 INFO_FIFO_ENTRY_CACHE_DESC_CACHE_NAME.get(),
729 cacheName);
730 }
731
732 if (entryCacheHits != null)
733 {
734 addMonitorAttribute(attrs,
735 ATTR_ENTRY_CACHE_HITS,
736 INFO_FIFO_ENTRY_CACHE_DISPNAME_HITS.get(),
737 INFO_FIFO_ENTRY_CACHE_DESC_HITS.get(),
738 entryCacheHits);
739 }
740
741 if (entryCacheTries != null)
742 {
743 addMonitorAttribute(attrs,
744 ATTR_ENTRY_CACHE_TRIES,
745 INFO_FIFO_ENTRY_CACHE_DISPNAME_TRIES.get(),
746 INFO_FIFO_ENTRY_CACHE_DESC_TRIES.get(),
747 entryCacheTries);
748 }
749
750 if (entryCacheHitRatio != null)
751 {
752 addMonitorAttribute(attrs,
753 ATTR_ENTRY_CACHE_HIT_RATIO,
754 INFO_FIFO_ENTRY_CACHE_DISPNAME_HIT_RATIO.get(),
755 INFO_FIFO_ENTRY_CACHE_DESC_HIT_RATIO.get(),
756 entryCacheHitRatio);
757 }
758
759 if (maxEntryCacheSize != null)
760 {
761 addMonitorAttribute(attrs,
762 ATTR_MAX_ENTRY_CACHE_SIZE,
763 INFO_FIFO_ENTRY_CACHE_DISPNAME_MAX_MEM.get(),
764 INFO_FIFO_ENTRY_CACHE_DESC_MAX_MEM.get(),
765 maxEntryCacheSize);
766 }
767
768 if (currentEntryCacheCount != null)
769 {
770 addMonitorAttribute(attrs,
771 ATTR_CURRENT_ENTRY_CACHE_COUNT,
772 INFO_FIFO_ENTRY_CACHE_DISPNAME_CURRENT_COUNT.get(),
773 INFO_FIFO_ENTRY_CACHE_DESC_CURRENT_COUNT.get(),
774 currentEntryCacheCount);
775 }
776
777 if (maxEntryCacheCount != null)
778 {
779 addMonitorAttribute(attrs,
780 ATTR_MAX_ENTRY_CACHE_COUNT,
781 INFO_FIFO_ENTRY_CACHE_DISPNAME_MAX_COUNT.get(),
782 INFO_FIFO_ENTRY_CACHE_DESC_MAX_COUNT.get(),
783 maxEntryCacheCount);
784 }
785
786 if (entriesAddedOrUpdated != null)
787 {
788 addMonitorAttribute(attrs,
789 ATTR_ENTRIES_ADDED_OR_UPDATED,
790 INFO_FIFO_ENTRY_CACHE_DISPNAME_PUT_COUNT.get(),
791 INFO_FIFO_ENTRY_CACHE_DESC_PUT_COUNT.get(),
792 entriesAddedOrUpdated);
793 }
794
795 if (evictionsDueToMaxMemory != null)
796 {
797 addMonitorAttribute(attrs,
798 ATTR_EVICTIONS_DUE_TO_MAX_MEMORY,
799 INFO_FIFO_ENTRY_CACHE_DISPNAME_EVICT_MEM.get(),
800 INFO_FIFO_ENTRY_CACHE_DESC_EVICT_MEM.get(),
801 evictionsDueToMaxMemory);
802 }
803
804 if (evictionsDueToMaxEntries != null)
805 {
806 addMonitorAttribute(attrs,
807 ATTR_EVICTIONS_DUE_TO_MAX_ENTRIES,
808 INFO_FIFO_ENTRY_CACHE_DISPNAME_EVICT_COUNT.get(),
809 INFO_FIFO_ENTRY_CACHE_DESC_EVICT_COUNT.get(),
810 evictionsDueToMaxEntries);
811 }
812
813 if (entriesNotAddedAlreadyPresent != null)
814 {
815 addMonitorAttribute(attrs,
816 ATTR_ENTRIES_NOT_ADDED_ALREADY_PRESENT,
817 INFO_FIFO_ENTRY_CACHE_DISPNAME_NO_PUT_ALREADY_PRESENT.get(),
818 INFO_FIFO_ENTRY_CACHE_DESC_NO_PUT_ALREADY_PRESENT.get(),
819 entriesNotAddedAlreadyPresent);
820 }
821
822 if (entriesNotAddedDueToMaxMemory != null)
823 {
824 addMonitorAttribute(attrs,
825 ATTR_ENTRIES_NOT_ADDED_DUE_TO_MAX_MEMORY,
826 INFO_FIFO_ENTRY_CACHE_DISPNAME_NO_PUT_MEM.get(),
827 INFO_FIFO_ENTRY_CACHE_DESC_NO_PUT_MEM.get(),
828 entriesNotAddedDueToMaxMemory);
829 }
830
831 if (entriesNotAddedDueToFilter != null)
832 {
833 addMonitorAttribute(attrs,
834 ATTR_ENTRIES_NOT_ADDED_DUE_TO_FILTER,
835 INFO_FIFO_ENTRY_CACHE_DISPNAME_NO_PUT_FILTER.get(),
836 INFO_FIFO_ENTRY_CACHE_DESC_NO_PUT_FILTER.get(),
837 entriesNotAddedDueToFilter);
838 }
839
840 if (entriesNotAddedDueToEntrySmallness != null)
841 {
842 addMonitorAttribute(attrs,
843 ATTR_ENTRIES_NOT_ADDED_DUE_TO_ENTRY_SMALLNESS,
844 INFO_FIFO_ENTRY_CACHE_DISPNAME_NO_PUT_TOO_SMALL.get(),
845 INFO_FIFO_ENTRY_CACHE_DESC_NO_PUT_TOO_SMALL.get(),
846 entriesNotAddedDueToEntrySmallness);
847 }
848
849 if (lowMemoryOccurrences != null)
850 {
851 addMonitorAttribute(attrs,
852 ATTR_LOW_MEMORY_OCCURRENCES,
853 INFO_FIFO_ENTRY_CACHE_DISPNAME_LOW_MEM_COUNT.get(),
854 INFO_FIFO_ENTRY_CACHE_DESC_LOW_MEM_COUNT.get(),
855 lowMemoryOccurrences);
856 }
857
858 if (percentFullMaxEntries != null)
859 {
860 addMonitorAttribute(attrs,
861 ATTR_PERCENT_FULL_MAX_ENTRIES,
862 INFO_FIFO_ENTRY_CACHE_DISPNAME_ENTRY_COUNT_PERCENT.get(),
863 INFO_FIFO_ENTRY_CACHE_DESC_ENTRY_COUNT_PERCENT.get(),
864 percentFullMaxEntries);
865 }
866
867 if (jvmMemoryMaxPercentThreshold != null)
868 {
869 addMonitorAttribute(attrs,
870 ATTR_JVM_MEMORY_MAX_PERCENT_THRESHOLD,
871 INFO_FIFO_ENTRY_CACHE_DISPNAME_JVM_MEM_MAX_PERCENT.get(),
872 INFO_FIFO_ENTRY_CACHE_DESC_JVM_MEM_MAX_PERCENT.get(),
873 jvmMemoryMaxPercentThreshold);
874 }
875
876 if (jvmMemoryCurrentPercentFull != null)
877 {
878 addMonitorAttribute(attrs,
879 ATTR_JVM_MEMORY_CURRENT_PERCENT_FULL,
880 INFO_FIFO_ENTRY_CACHE_DISPNAME_JVM_MEM_CURRENT_PERCENT.get(),
881 INFO_FIFO_ENTRY_CACHE_DESC_JVM_MEM_CURRENT_PERCENT.get(),
882 jvmMemoryCurrentPercentFull);
883 }
884
885 if (jvmMemoryBelowMaxMemoryPercent != null)
886 {
887 addMonitorAttribute(attrs,
888 ATTR_JVM_MEMORY_BELOW_MAX_MEMORY_PERCENT,
889 INFO_FIFO_ENTRY_CACHE_DISPNAME_JVM_MEM_BELOW_MAX_PERCENT.get(),
890 INFO_FIFO_ENTRY_CACHE_DESC_JVM_MEM_BELOW_MAX_PERCENT.get(),
891 jvmMemoryBelowMaxMemoryPercent);
892 }
893
894 if (isFull != null)
895 {
896 addMonitorAttribute(attrs,
897 ATTR_IS_FULL,
898 INFO_FIFO_ENTRY_CACHE_DISPNAME_IS_FULL.get(),
899 INFO_FIFO_ENTRY_CACHE_DESC_IS_FULL.get(),
900 isFull);
901 }
902
903 if (capacityDetails != null)
904 {
905 addMonitorAttribute(attrs,
906 ATTR_CAPACITY_DETAILS,
907 INFO_FIFO_ENTRY_CACHE_DISPNAME_CAPACITY_DETAILS.get(),
908 INFO_FIFO_ENTRY_CACHE_DESC_CAPACITY_DETAILS.get(),
909 capacityDetails);
910 }
911
912 return Collections.unmodifiableMap(attrs);
913 }
914 }