2 Replies Latest reply on Aug 19, 2012 1:10 PM by Gael

    LoadEventFrames doesn't seem to load everytime!!!

    Gael

      Hello,

       

      We have noticed that the loadEventFrames method is not fully loading the full list of event frames every time we run it. Therefore, the loop on each object to get the referenced elements could be long. This is not constant and seems to be a problem of cache or from the loadeventframes!!!

       

      We are doing the test with 20000 events. Here below is the code used to perform the test.

       

       

       

      'Locals variables
              Dim AfEfListAll As IList(Of AFEventFrame)
              Dim AfEfList As IList(Of AFEventFrame) = New List(Of AFEventFrame)
              Dim _PiSyst As PISystem
              Dim _PiSysts As New PISystems
              Dim _afDb As AFDatabase
      
              'Connection to PI/AF System.
              _PiSyst = _PiSysts(txt_PISyst.Text)
              _PiSyst.Connect()
      
              'Connection to AF database.
              _afDb = _PiSyst.Databases(txt_afdb.Text)
      
              'Local variables.
              Dim afElmtCollection As AFNamedCollectionList(Of AFElement)
              Dim afElmt As AFElement
      
              'Get all AF Element matching the name of the AF element name.
              afElmtCollection = AFElement.FindElements(_afDb, Nothing, txt_Elmt.Text, Nothing, Nothing, AFElementType.None, True, AFSortField.ID, AFSortOrder.Ascending, 1)
      
              'AF Element has been found.
              afElmt = afElmtCollection(0)
      
              'Search Event Frames.
              AfEfListAll = AFEventFrame.FindEventFrames(_afDb, _
                                             Nothing, AFSearchMode.Overlapped, txt_ST.Text, txt_ET.Text, _
                                             Nothing, txt_Elmt.Text, _
                                              _afDb.ElementCategories(txt_EFCatg.Text), Nothing, Nothing, _
                                              True, AFSortField.StartTime, AFSortOrder.Descending, 0, 300000)
      
              If chxAFCacheClear.Checked = True Then
                  OSIsoft.AF.Diagnostics.AFCache.Clear()
                  OSIsoft.AF.Diagnostics.AFCache.CacheTime = txtCachetime.Text
              End If
      
              AFEventFrame.LoadEventFrames(AfEfListAll)
      
              'Validation des event frame retrouvés
              For Each afEventFrame As AFEventFrame In AfEfListAll
      
                  If afEventFrame.ReferencedElements.Contains(afElmt) Then
                      AfEfList.Add(afEventFrame)
                  End If
      
              Next
      

       

       

      This code is used only for testing because it is part of a bigger application.

       

       

       

       

       

      Thanks in advance for your inputs.

       

       

       

      PS: I have also opened a call with the techsupport.

       

       

       

      Best regards

       

       

       

      Gael

       

       

        • Re: LoadEventFrames doesn't seem to load everytime!!!
          cnelson

          Hi Gael and Community:

           

          The LoadEventFrame method is indeed designed to load the ReferencedElements into the client and as such there should not be an additional performance hit when executing the contains method.  I have verified this using the BETA3 release of AF 2012.

           

          There are several questions that I have but I'll ask them through the support call and then post the resolution of this issue.

           

          I want to be clear, this behavior is not expected.  We highly encourage everyone who is concentrating on high performance software to use bulk loading strategies wherever possible.

           

          Stay tuned :)

           

          Cheers - Chris