Capture time stamp for FRU collection

The commit adds code to capture start and end time with respect to VPD
collection of respective FRU.
This information will help in troubleshooting efficiency issue as well
as improving performance in case required.

Change-Id: I91977b981dd6fbed7db565721457f0bb5dc704dd
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
diff --git a/vpd-manager/src/worker.cpp b/vpd-manager/src/worker.cpp
index f2731e0..179e7ec 100644
--- a/vpd-manager/src/worker.cpp
+++ b/vpd-manager/src/worker.cpp
@@ -1376,6 +1376,10 @@
 
         if (!l_inventoryPath.empty())
         {
+            // save time stamp under PIM.
+            vpdSpecificUtility::saveTimeStampInPim(l_inventoryPath,
+                                                   "StartTime");
+
             if (!dbusUtility::writeDbusProperty(
                     jsonUtility::getServiceName(m_parsedJson, l_inventoryPath),
                     l_inventoryPath, constants::vpdCollectionInterface,
@@ -1394,6 +1398,10 @@
             types::ObjectMap objectInterfaceMap;
             populateDbus(parsedVpdMap, objectInterfaceMap, i_vpdFilePath);
 
+            // save end time stamp under PIM.
+            vpdSpecificUtility::saveTimeStampInPim(l_inventoryPath,
+                                                   "CompletedTime");
+
             // Notify PIM
             if (!dbusUtility::callPIM(move(objectInterfaceMap)))
             {
@@ -1413,6 +1421,10 @@
         setCollectionStatusProperty(i_vpdFilePath,
                                     constants::vpdCollectionFailed);
 
+        // save end time stamp under PIM.
+        vpdSpecificUtility::saveTimeStampInPim(l_inventoryPath,
+                                               "CompletedTime");
+
         // handle all the exceptions internally. Return only true/false
         // based on status of execution.
         if (typeid(ex) == std::type_index(typeid(DataException)))