SharePoint 2010 Developer Dashboard

stsadm (deprecated):

stsadm -o setproperty -pn developer-dashboard -pv OnDemand

 

PowerShell:

$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService

$addsetting =$service.DeveloperDashboardSettings

$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand

#$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On

#$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off

$addsetting.Update()

http://blogs.technet.com/b/patrick_heyde/archive/2009/11/16/sharepoint-2010-enable-using-developer-dashboard.aspx

http://msdn.microsoft.com/en-us/library/office/ff512745(v=office.14).aspx

(Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = ”On”
(Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = ”OnDemand”

 

 

SPDeveloperDashboardSettings settings =
SPWebService.ContentService.DeveloperDashboardSettings;
settings.DisplayLevel = SPDeveloperDashboardLevel.On;
settings.TraceEnabled = true;
settings.Update();

SharePoint 2010 Developer Dashboard

JS alerts

(взято с http://www.mediacollege.com/internet/javascript/basic/alert.html)

Простой алерт

<script language=”javascript” type=”text/javascript”>

alert(‘This is what an alert message looks like.’);

</script>

 

Алерт переменной

var a = document.location;
alert(a);

 

Алерт составной

function showAlert() {
      var country = "Fiji";
      var city = "Suva";
      alert('The city of ' + city + ' is located in ' + country + '.');
}
<input type="button" value="Click Here" onClick="showAlert();">

 

JS alerts

test

display DB size

USE DBNAME
GO
EXEC sp_spaceused
GO

 

Display DB and log file size

USE DBNAME;
GO
SELECT file_id, name, type_desc, physical_name, size, max_size
FROM sys.database_files ;
GO
test