Kiln »
KilnSupportScriptsPowershell Scripts to help monitor a Kiln environment. Contact Fog Creek support before using.
Alias information
is an alias for .
Mercurial and Git clients can push and pull from this alias URL to interact with this repository. You can change to which repository an alias points by going to the Aliases link on the project page.
functionGet-URL([string]$url){(New-Objectnet.webclient).DownloadString($url)}$g_backendUrl="http://localhost:56783/"functionTest-KilnVersion(){try{$resp=Get-Url(($g_backendUrl+"version"))return($resp.length-gt0)}catch{return$False}}functionTest-KilnDiff([string]$sRepoGUID,[string]$sChangeset1,[string]$sChangeset2){try{$url=$g_backendUrl+"repo/"+$sRepoGUID+"/diff/"+$sChangeset1+":"+$sChangeset2+"?format=json&ignorews=True&maxsize=100000&timeout=10"$resp=Get-Url($url)return($resp.length-gt0)}catch{return$False}}functionLog-ServiceStats([string]$service,[string]$logFile){try{$measure=get-process$service-ErrorActionStop|Measure-ObjectWorkingSet-sumwrite"$(Get-Date -format o) The service $service has $($measure.Count) instances with a total WorkingSet of: $($measure.Sum)"|out-file-append$logFile}catch{write"$(Get-Date -format o) The service $service is not currently running."|out-file-append$logFile }
}
-function Check-KilnBackend([string] $sRepoGUID, [string] $sChangeset1, [string] $sChangeset2, [string] $logFile){
+function Check-KilnBackend([string] $sRepoGUID, [string] $sChangeset1, [string] $sChangeset2){
if (-Not ((Test-KilnVersion) -and (Test-KilnDiff $sRepoGUID $sChangeset1 $sChangeset2))){
#Restart the Kiln storage Service because something bad happened
- write "$(Get-Date -format o) Something is wrong. Restarting Kiln Storage Service" | out-file -append $logFile+ write "$(Get-Date -format o) Something is wrong. Restarting Kiln Storage Service"
Restart-Service "KilnStorageService"
return False
}
else {
- write "$(Get-Date -format o) Kiln backend is OK" | out-file -append $logFile+ write "$(Get-Date -format o) Kiln backend is OK"
return True
}
}
Attach a Trello Card
Add a tag
Your session has expired
You are no longer logged in. Please log in and try your request again.
Filter RSS Feed
This RSS feed URL allows you to see the contents of your current filter using any feed reader.
This link includes a special authentication token. If you share the URL with anyone else, they can see this RSS feed's activity. You can disable these tokens when needed.
Your current filter is unsaved; changing it won't affect this RSS feed.