9 Replies Latest reply on Feb 5, 2015 3:42 PM by Rick Davin

    How to find PI database size through which we receive files everyday, in terms of GB??

    Janani

      Hi ,

       

      I am looking on for a problem statement where in you have to find the amount of real time data we receive in PI server everyday in terms of gigabytes.

       

      Please let me know if there is a way.

       

      Thanks in Advance!

        • Re: How to find PI database size through which we receive files everyday, in terms of GB??
          bshang

          Hi Janani,

           

          Are you looking to determine this programatically or via a system management tool? If the matter, perhaps the easiest way is via PI System Management Tools>Operation>Archives. Each archive will list a "% full" column which along with the file size, allows you to determine the amount of space used in GB. Another estimate is to look at the Lifetime of each archive file. The size of the archive file / Lifetime will give you an idea of how fast the server is growing in terms of GB.

          • Re: How to find PI database size through which we receive files everyday, in terms of GB??
            gachen

            Hi Janani,

             

            You could probably approximate this by setting up a perfmon tag to read the Archived Events/sec perfmon counter, then having a totalizer tag setup to integrate this rate value over the span of a day. This should give an approximate value of the number of events archived in that day. Once you have this value, multiply by 32 bits/event (approximating one event = 32 bits based on float32) then divide by (8*1024^3) to get your approximate answer in GB.

            • Re: How to find PI database size through which we receive files everyday, in terms of GB??
              gregor

              Hello Janani,

               

              Another option coming into my mind would be using piartool.exe to query the list of registered archives (piartool -al). The archive listing contains detailed information, as well for the size of the belonging annotation file. Programmatically you can use the Process class to interact with piartool.exe. The challenge will be to properly read information from the returned stream.

              • Re: How to find PI database size through which we receive files everyday, in terms of GB??
                gachen

                The totalizer tag will do the integration by default, assuming it is set to a calculation mode of total and is time-weighted. You'll want to make sure you use a conversion factor though, as it assumes the rate is in units/day. Since the source tag would be events/sec, we would want to multiply by 86400 to get events/day.

                 

                Float32 is definitely not the data type that consumes the maximum bits/event. I used float32 as the approximation, since usually most tags on a PI Data Archive server are likely to be of type float32. If you have more tags of another type, then definitely use that as your approximation. A double (float64) would be 64 bits. Strings are harder to approximate, because that would depend on the length of your string.

                 

                Barry, Gregor and Anna have also provided good suggestions. Their methods might potentially provide more accuracy in terms of the actual GB changes/day. I also like Gregor's approach because it accounts for annotations (not sure if you're interested in this, since you had only specified "real time data"). One thing to keep in mind though, is that when taking the approach of looking at archive stats, you may want to get them for each archive to account for out-of-order/backfilled data that go into different archives.

                • Re: How to find PI database size through which we receive files everyday, in terms of GB??
                  André Åsheim

                  Since the archives have fixed size I created a analysis that calculates the average disk growth every day:

                  MBChange7days: if(BadVal(TagAvg('C:|Available MB' , 't-7d' , 't-14d') - TagAvg('C:|Available MB' , 't' , 't-7d'))) then -1 else TagAvg('C:|Available MB' , 't-7d' , 't-14d') - TagAvg('C:|Available MB' , 't' , 't-7d')
                  MBChangeDay: if(MBChange7days = -1) then -1 else MBChange7days / 7
                  Forecast: If BadVal(MBChangeDay) then -1 else if(MBChangeDay <= 0) then -1  else if MBChangeDay < -1 then -1 else (TagVal('C:|Available MB','*') / MBChangeDay)
                  Output: if(Forecast = -1) then NoOutput() else if(BadVal(Forecast)) then NoOutput() else if (Forecast <= 0) then NoOutput() else Forecast
                  

                  (My output is number of days until the disk is full)