Get Database, but rather can do this once in the constructor and Simple Data will take care of opening and closing the connections as needed.After making these two fixes the profiler results after a third run don’t indicate anything specific that can be “fixed”, so it was time to push it up to our testing environment and do some real testing.The main reason for this afar as I can see from reading their docs is that New Relic depends on an active Http Context for profiling applications.Having used New Relic to pinpoint the performance problems in our web app, I started to think about what it would take to build something similar but for a Windows Service.I started by setting the project I wanted to profile as the “Startup project”.Then from the Analyze menu, selected Performance and Diagnostics, which brings up the following window I then selected Performance Wizard under Available Tools and then clicked the Start button.Because we put this Version number in it means comparing performance between versions becomes trivial.In Splunk I created the following dashboard, which allows me or any of my fellow developers at Dr Doctor to select an Application and Transaction and then a baseline and comparison version.
The Reporting service then started and Visual Studio started profiling, after about 5 minutes I stopped the profiling. The good news here is that this is our code, which means I can click on this row and visual studio will take me to this method, and even highlight the expensive code. Write Report To Db row brings up the code for that method This c# code probably has any DBA wriggling in their seat right about now (sorry!
What this chart is showing is that the reporting service is working at a very constant and slow pace.
It will eventually get through the backlog of messages, but it takes it a few hours each morning while the CPU sits at around 100%.
Judging by the results shown above, it’s working at roughly twice the speed, I’d have hoped for it to be a bit faster than that, but still I’m not complaining! Submit(Receiver Submit Args args, String data) After I discovered that it constantly just timed out I started to look around for an alternative to using the Splunk REST Api endpoint.
Our Reporting service does two things it writes all IReport Item messages which it processes to their respective table in the database and the second thing is write all events into a log file for Splunk to index. I’ve always noticed that Splunk lets you send events data to it via TCP/UDP but have never had cause or reason to use it.