2 Replies Latest reply on Feb 5, 2015 5:16 PM by lgferrao

    Slow execution of FindAttributesPath in Windows Server 2012

    lgferrao

      Hi,

      I have the following code to get attributes values from AF Servers:

       

      using OSIsoft.AF.Asset;

      using System;

       

      namespace CmdConexaoAF

      {

          class Program

          {

              static void Main(string[] args)

              {

                  Console.WriteLine(string.Format("{0} {1}", DateTime.Now, "Start FindAttributesByPath..."));

                  var attributes = AFAttribute.FindAttributesByPath(

                      new string[] { "\\\\AFSERVER\\DATABASE\\ROOT\\ELEMENT|ATTRIBUTE" },

                      null);

                  Console.WriteLine(string.Format("{0} {1}", DateTime.Now, "Finish FindAttributesByPath..."));

       

                  Console.WriteLine(string.Format("{0} {1}", DateTime.Now, "Start GetValue..."));

                  var attributesValues = new AFAttributeList(attributes).GetValue();

                  Console.WriteLine(string.Format("{0} {1}", DateTime.Now, "Finish GetValue..."));

       

                  foreach (var attributeValue in attributesValues)

                  {

                      Console.WriteLine(string.Format("{0} = {1}", attributeValue.Attribute.GetPath(), attributeValue.ToString()));

                  }

       

                  Console.ReadKey();           

              }

          }

      }

       

      This code is part of a MVC4 application. I focus in the essence of the code to show my problem...

       

      I need to execute using the attribute path, because I could need to find in the same execution attributes from diferents elements, databases and servers.

       

      When I execute in the developer machine, the execution is normal. This code runs in 1 second.

       

      But when I run in the Windows Server 2012 the result is as following:

      The find paths spends one minute to execute!

       

      I tested the name resolution from DNS and I didn't find any problem.

       

      If someone has another ideias about how to solve this problem I'll thank!