惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - A A

SharePoint 2013 App 未在此网站上启用应用程序的旁加载 SharePoint Error 查询命令 SharePoint 2013 基于主机头创建站点无法访问 SharePoint 2013 APP 之---很抱歉,应用程序已关闭。如果您知道运行服务器的人员,请告诉他们启用应用程序。 SharePoint服务器修改域和机器名 CAML 多表查询 SPQuery.Joins and ProjectedFields SharePoint 2010 你状态机了吗! SharePoint 文档库打开HTML 直接浏览而不是打开下载对话框 SharePoint Write Logs User Profile Data Web Part 读取属性字段 ECMAScript Client OM(传说中的js客户端编程) - A A 自定义个性化 EditPeople控件 - A A 使用SharePoint Management PowerShell来完成对SharePoint的操作 使用SharePoint 人员选择控件 在 WEB APP开发 - A A SharePoint 在Default 下面添加服务端代码 - A A SharePoint 页面库 使用footer - A A 10分钟搞定 SharePoint 集成FCKEditor 标准项目文档 获取AD用户和OU属性字段名称
Developer Dashboard 排忧解难!!!
A A · 2010-11-30 · via 博客园 - A A

描述:

   今天在客户现场遇到一个怪异的问题,SharePoint 2010 首页突然访问奇慢无比呀(其他站点正常),可是昨天晚上还是好好的嘛,今天又要给领导汇报,给我急得啊,愁死我了。。

感觉是那个webpart 出问题了,可是以前都是好好的呀,初步排查应该是首页那个webpart的访问数据有问题,导致的情况,

首页无非是,内容查询 ,内容编辑 EXCEL相关webpart 为了搞清楚 具体是那个webpart 导致我的首页奇慢无比嘛~~~

百思不得其解中,突然想起来SharePoint2010 自带了 Developer 仪表盘 来分析网站的执行情况。(开启服务后,豁然开朗。。。。)

2种方法:

Code:

SPPerformanceMonitor perfmon = SPFarm.Local.PerformanceMonitor;

perfmon.DeveloperDashboardLevel = SPPerformanceMonitoringLevel.On;

perfmon.Update();

cmd:

STSADM –o setproperty –pn developer-dashboard –pv on(or "on" or "off")

使用 SPMonitoredScope  监控你的代码 具体情况

使用SPMonitoredScope可以很方便的将某段代码的相关性能信息输出到Developer Dashboard中。使用SPMonitoredScope很简单,首先声明一个SPMonitoredScope的实例并赋予一个可以追踪的名字,将需要Track的代码写入即可。例如,下边的代码演示了插入一个列表项:

using (SPMonitoredScope monitoredScope = new SPMonitoredScope("My Monitored Scope"))

{

    // put code to monitor performance on here

    SPList testList = site.Lists.TryGetList("Test List");

    if (testList != null)

    {

        SPListItem listItem = testList.Items.Add();

        listItem["Title"] = string.Format("Test Item {0}", Guid.NewGuid().ToString());

        listItem["City"] = "Somewhere";

        listItem["Quantity"] = 3;

        listItem.Update();

    }

}
 

在SPMonitoredScope中你还可以嵌套使用SPMonitoredScope对象以更详细的监控尽可能小的代码段来分析器性能。

using (SPMonitoredScope monitoredScope = new SPMonitoredScope("My Monitored Scope"))

{

    SPList testList;

    using (SPMonitoredScope getListMonitor = new SPMonitoredScope("Get List"))

    {

        testList = site.Lists.TryGetList("Test List");

    }

    using (SPMonitoredScope addListItemMonitor = new SPMonitoredScope("Add List Item"))

    {

        if (testList != null)

        {

            SPListItem listItem = testList.Items.Add();

            listItem["Title"] = string.Format("Test Item {0}", Guid.NewGuid().ToString());

            listItem["City"] = "Somewhere";

            listItem["Quantity"] = 3;

            listItem.Update();

        }

    }

}
 

正如期望的,我们在My Monitored Scope中看到了更为详细的监控段Get List和Add List Item。这样就能很清楚的看到每个代码段的性能情况。