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