Tuesday, July 22, 2014

Saving and Sharing Web Page Performance Information from Chrome

I was perusing a web site during lunch and once again lamenting its performance. I fired up the devtools for chrome and the Network tab does a good job of showing you the sticking points in the app and I was wondering if there is a way to share this sort of information. It turns out there is. The data from the Network tab can be saved in a format called HAR. HAR is a JSON format that contains all of the data you see in the network tab in devtools.

There appear to be quite a few tools available for allowing you to view HAR data. The most accessible one I found was here http://ericduran.github.io/chromeHAR/

A good summary of HAR files is here



If you want to save data from the network tab in a HAR file in Chrome devtools, right click in the log of network traffic and select Save As HAR With Content. This file can then be dropped onto the above HAR viewer page and you can see the output, including the timeline.

Friday, June 27, 2014

Cleaning up Disk Space on Your Machine

One recurring annoyance with working on lots of different projects is that over time your disk just gets full. Working in many MS SQL Server databases over the years I've noticed that there is a pretty simple way I can usually reclaim a lot of diskspace from SQL Server on my machine. I currently have over 100 development databases on my machine and a lot of those were one time uses. I'm sure I could remove a bunch of them, but in a pinch, this allowed me to very quickly reclaim over 30GB of disk space

Dynamically generate the dbcc shrink database syntax for all of the databases on my box

select 'dbcc shrinkdatabase([' + name + '], TRUNCATEONLY);' from sys.databases where name <> 'master'


copy the output into a sql server query window and run it

I had issues with one database because it was restoring. After removing that database from the list of queries, it ran rather quickly and I got a gobs of disk space back. If you have databases on your machine that you do not want to shrink, you can remove those from the list

For more information on SHRINKDATABASE

http://msdn.microsoft.com/en-us/library/ms190488.aspx

Update

You can use the following to generate a dynamic sql statement and execute it using EXEC

DECLARE @SQL VARCHAR(MAX)

select @SQL = COALESCE(@SQL,'') + '
dbcc shrinkdatabase([' + name + '], TRUNCATEONLY);' from sys.databases
where name not in ( 'master', 'model', 'tempdb', 'msdb')

print cast(@SQL as ntext)

EXEC(@SQL)

Tuesday, July 3, 2012

Fun and insightful read

The Codeless Code is a fun read. Also it looks like it has been waaaaay too long since I've posted anything. I've been at a new job since Oct 2011, and am working mainly in javascript these days. Quite a change from C# in a lot of ways, and most of them good as far as I'm concerned, with the exception of issues I seem to continually have with supporting libraries we use. That and my CSS knowledge is somewhere between none and enough to be dangerous. I need to work on that.

Friday, July 8, 2011

webrat needs to be bundled as well

In addition to getting rspec installed correctly, webrat is required to test the page content with response.should have_selector("title"....

Here are the instructions. I had to include the proper version (0.7.0) in the Gemfile, then do a bundle install.

getting rspec installed

The tutorial I'm using calls for using rspec for testinhttp://www.blogger.com/img/blank.gifg. In order to get it so I could install it and add it I had to follow these instructions.

Thursday, July 7, 2011

Finally really working on Rails

After several false starts we have a project at work where we are looking at using Rails. So far so good. I'm using http://ruby.railstutorial.org/ruby-on-railshttp://www.blogger.com/img/blank.gif-tutorial-book as my tutorial and so far it is my kind of book. I'm using the bitnami rubystack virtual machine using Rails 3 in ubuntu. There have been a couple of hiccups along the way. 1) is remembering to use sudo on the VM for most installs and updates and even running the server to test the appliction. Not a HUGE deal, but a minor annoyance. Also, when doing the push the first time to deploy to heroku, I got an error saying that heroku does not appear to be a git repository. The fix for that is here.