且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

跟踪报告使用情况

更新时间:2023-11-10 08:04:52

在以下 文章.

例如,如果您想查看最常用的报告,您可以执行以下操作:

For example, if you want to see the most used reports, you can do the following:

SELECT COUNT(Name) AS ExecutionCount,
       Name,
       SUM(TimeDataRetrieval) AS TimeDataRetrievalSum,
       SUM(TimeProcessing) AS TimeProcessingSum,
       SUM(TimeRendering) AS TimeRenderingSum,
       SUM(ByteCount) AS ByteCountSum,
       SUM([RowCount]) AS RowCountSum
  FROM (SELECT TimeStart,
               Catalog.Type,
               Catalog.Name,
               TimeDataRetrieval,
               TimeProcessing,
               TimeRendering,
               ByteCount,
               [RowCount]
          FROM Catalog
               INNER JOIN 
               ExecutionLog
                 ON Catalog.ItemID = ExecutionLog.ReportID
         WHERE Type = 2
       ) AS RE
GROUP BY Name
ORDER BY COUNT(Name) DESC,
         Name;

需要注意的一点是,默认情况下,执行日志只会保留 2 个月的数据.您可以使用 ExecutionLogDaysKept 服务器属性控制此行为,请参阅 这篇技术文章.

One thing to note is that by default the execution log will only keep 2 months worth of data. You can control this behaviour with the ExecutionLogDaysKept server property, see this technet article.