コード例 #1
0
 public static void IncrementData(CmdletInfo cmdlet)
 {
     if (!PSSQMAPI.isWinSQMEnabled || cmdlet.PSSnapIn == null || !cmdlet.PSSnapIn.IsDefault)
     {
         return;
     }
     PSSQMAPI.IncrementDataPoint(cmdlet.Name);
 }
コード例 #2
0
        public static void IncrementData(CommandTypes cmdType)
        {
            if (!PSSQMAPI.isWinSQMEnabled)
            {
                return;
            }
            PSSqmDataPoint psSqmDataPoint;

            switch (cmdType)
            {
            case CommandTypes.Alias:
                psSqmDataPoint = PSSqmDataPoint.Alias;
                break;

            case CommandTypes.Function:
                psSqmDataPoint = PSSqmDataPoint.Function;
                break;

            case CommandTypes.Alias | CommandTypes.Function:
                return;

            case CommandTypes.Filter:
                psSqmDataPoint = PSSqmDataPoint.Filter;
                break;

            case CommandTypes.Cmdlet:
                psSqmDataPoint = PSSqmDataPoint.Cmdlet;
                break;

            case CommandTypes.ExternalScript:
                psSqmDataPoint = PSSqmDataPoint.ExternalScript;
                break;

            case CommandTypes.Application:
                psSqmDataPoint = PSSqmDataPoint.Application;
                break;

            case CommandTypes.Script:
                psSqmDataPoint = PSSqmDataPoint.Script;
                break;

            default:
                return;
            }
            PSSQMAPI.IncrementDataPoint((uint)psSqmDataPoint);
        }
コード例 #3
0
 public static void LogAllDataSuppressExceptions()
 {
     if (!PSSQMAPI.isWinSQMEnabled)
     {
         return;
     }
     lock (PSSQMAPI.syncObject)
     {
         long ticks = DateTime.Now.Ticks;
         if (ticks - PSSQMAPI.startedAtTick < PSSQMAPI.timeValueThreshold)
         {
             return;
         }
         PSSQMAPI.FlushDataSuppressExceptions();
         PSSQMAPI.startedAtTick = ticks;
     }
 }
コード例 #4
0
 private static void CurrentDomain_ProcessExit(object source, EventArgs args) => PSSQMAPI.LogAllDataSuppressExceptions();