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