PEL: Add PEL repository capping related fields

If not capped, the PEL repository would keep taking up more and more
space as more PELs are added.  In preparation for handling this, add
a field to the Repository class to track the total size that all PELs can
take up and a field to track the maximum number of PELs that can be
stored.

The size value is hardcoded to be 20MB (and 100KB in unit test), though
a Repository class constructor allows the number to use to be passed in.
The max number of PELs field is hardcoded to 3000 (100 in test) and this
can also be changed in the constructor.

In the future if different systems or configurations require different
values, then this could be set at configure time.  This isn't done now
because I want to only add PEL options to the common phosphor-logging
configure.ac if absolutely necessary as the majority of phosphor-logging
users don't use PELs.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I72609a727229f96bd8ac23a630f25fd8b5c73427
diff --git a/extensions/openpower-pels/paths.cpp b/extensions/openpower-pels/paths.cpp
index a9e865c..14e5d71 100644
--- a/extensions/openpower-pels/paths.cpp
+++ b/extensions/openpower-pels/paths.cpp
@@ -25,6 +25,8 @@
 {
 
 namespace fs = std::filesystem;
+static constexpr size_t defaultRepoSize = 20 * 1024 * 1024;
+static constexpr size_t defaultMaxNumPELs = 3000;
 
 fs::path getPELIDFile()
 {
@@ -45,5 +47,19 @@
     return std::filesystem::path{"/usr/share/phosphor-logging/pels"};
 }
 
+size_t getPELRepoSize()
+{
+    // For now, always use 20MB, revisit in the future if different
+    // systems need different values so that we only put PEL
+    // content into configure.ac when absolutely necessary.
+    return defaultRepoSize;
+}
+
+size_t getMaxNumPELs()
+{
+    // Hardcode using the same reasoning as the repo size field.
+    return defaultMaxNumPELs;
+}
+
 } // namespace pels
 } // namespace openpower