Scott Hanselman

Scott Hanselman (that's me) on .NET Rocks! Live! Friday 9am PST over Windows Media and Skype.

February 19, '04 Comments [3] Posted in ASP.NET | DevDays | Web Services | XML
Sponsored By

Tomorrow (assuming I get up) I'll be on .NET Rocks Live! with Carl Franklin and Rory Blyth.  It's like Howard Stern, but with code, and it doesn't suck.

We're going to chat about all sorts of fun stuff. ASP.NET, XML, Web Services, Perf Counters, DevDays, etc.

Please do check it out.  If you're on the East Coast, listen to us at 12pm EST as if we were your lunch time radio show (the .NET Gang, those wacky pundits :) ), and if you're on the West Coast listen to us at 9am PST and pretend we're the .NET Morning Zoo!

If you'd like, check out my first .NET Rocks show, it's archived!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Performance Counters in ASP.NET

February 18, '04 Comments [2] Posted in ASP.NET
Sponsored By

Did some great performance testing this last Sunday on the bank we're taking live soon.  We needed to get a few thousand users on the box, all banking at the same time.  The Host Interface side has some great performance counters that made it very easy to measure.  Even though they have a rich serious of counters, I added some counters to the UI side. 

As I've mentioned before, we describe our Domain Objects and Messages with XSD, and generate loads of C# code with CodeSmith (and some with XSLT).  Using these 'nouns' we create services (verbs) that act on them as they move through the system.  We build 1st class interfaces on top of a 3rd class router that basically does an Invoke/Execute/DoIt/IDispatch...a lot the way Invoke() works with ASMX WebServices. 

There's a whole vocabulary of messages that can be sent to Voyager, like 'GetAccounts' or 'AddPayment.'  Some come with Voyager and some are added for the implementation. 

Typically with Performance Counters there are either static counters, like 'Avg Bytes/sec' through the system, or instance counters like 'Bytes/sec on this hard drive.'  Often these instance counters are per process, or per piece-of-hardware. 

But since the verbs that head through the system can be dynamic, why not make new per counters as we see new verbs? (there's usually no more than 100, really usually <50)  So, on both the UI and HI we can look at instance Performance Counters like 'Time in (ms) for GetAccounts' or 'Bytes Out for AddPayee.' 

By adding the same counters but for an 'instance' that is really a verb, we can find out when a certain operation (verb) is not performing well on the system. 

And, since we can look at what the UI's round-trip time is (for example, 500ms) and what the HI's times are (200ms to the host, 150ms in the code) we can start measuring interstitial times like marshalling time, logging overhead, etc. at a very granular level.

Fortunately we baked in hooks to allow Performance Counters early on in the project.  You should to!  It's nice to REALLY know what's happening in your app.  The less of a black box your own app feels like, the more confident you can be when you make Service Level Agreements and predictions as to performance.  Nothing is more scary than NOT knowing how to measure your own application.

Tips and Best Practices:

  • Remember the ASPNET process has access to WRITE to Performance Counters, but not READ, CREATE, or DELETE counters.
  • Add an Installer class to your ASP.NET application that does the creating of the PerformanceCategory, the creation of the PerformanceCounters and the deletion at uninstall.  You can run 'installutil [/u] yourclass.dll' from the command-line.  You can also add your installer dll to the Custom Actions section of your Web Setup and the Performance Counters will get created/deleted automatically when your MSI runs.
  • Use some High Performance Timer for your timing - don't use DateTime.anything.

It was a good weekend.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Choosing the best computer for you...in 1982.

February 18, '04 Comments [10] Posted in Musings
Sponsored By

Found this little gem in the archives and scanned it for y'all.  Couple of great ads inside. 

  • An IBM PC ad, the one with Charlie Chaplin - 16k bytes.  16 bit, 8088.  optional 5.25" 160k floppy.  4-color 320x200. Good times.  Only $3k.
    "The modem that plugs into your phone takes the codes your IBM Personal Computer understands and turns them into signals that can be transmitted over phone lines"
  • Some nice articles on acoustic vs. direct-connect models. The acoustic model from Novation was only $189.
  • This was back before computing was limited to a few companies. Some highlighted models:
    • $g(Apple II)
    • $g(Atari 800)
    • $g(Commodore 64)
    • $g(Franklin ACE 1000)
    • $g(IBM PC)
    • $g(TRS 80 Model III)
    • $g(Apple III)
    • $g(Casio FX9000P)
    • $g(Corvus Concept)
    • $g(Cromemco C10)
    • $g(DEC Rainbow 100)
    • $g(Fortune 32 16)
    • $g(Heathkit H90 Zenith Z89)
    • $g(MTU130)
    • $g(NEC APC)
    • $g(North Star Advantage)
    • $g(Olivetti M20)
    • $g(TFI if800)
    • $g(Victor 9000)
    • $g(Wang PC)
    • $g(Xerox 820II)
    • $g(Dynalogic Hyperion)
    • $g(Epson HX20)
    • $g(Grid Compass)
    • $g(Kaypro II)
    • $g(Lexicon LEX31)
    • $g(Osbourne I)
    • $g(Otrona Attache)
    • $g(Panasonic RLH1000)
    • $g(Sharp PC1500)
    • $g(Atari 400)
    • $g(Commodore VIC 20)
    • $g(TI99 4A)
    • $g(Timex Sinclar 1000)
    • $g(TRS80 Color Computer)

Do you have any fond memories of these beauties?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Test Coverage IS important...

February 18, '04 Comments [4] Posted in Programming | Tools
Sponsored By

This fellow said:

"I would much rather aim for 100% test-driven development than aim for 100% test coverage."

But I fear he's missing the point.  If I'm only testing 1% of my code paths, 100% of the time, what am I accomplishing? Squat. 

As my boss has said, adding a non-intrusive code coverage tool to an already successful unit-testing strategy can absolutely find gaps in coverage that staring at the screen just won't find. 

But juxtaposing 100% TDD with a 100% coverage goal doesn't make sense.  They are complimentary, parallel even, but not opposing goals.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Googling by Filetype!

February 14, '04 Comments [0] Posted in XML
Sponsored By

Well this will just change my life...I can Google by FileType...Here's a search for all PowerPoints with the word Zen in them:

http://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&safe=off&q=%22Zen%22+filetype%3Appt&btnG=Google+Search

Just by putting "Zen" filetype:ppt in the Google search box. Yum.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.