Developer's Guide - Code Samples
In This Topic
This is a collection of the significant code samples available throughout the documentation.
Alerting
Configuration
- Configuration through Code: You can configure the Agent through code instead of using an App.Config for most scenarios (the primary exception being ASP.NET where the web.config is highly recommended). This example shows a WinForm application being configured programmatically.
- Add the Loupe Trace Listener: A quick way to add just the Loupe Trace listener to your application.
Logging
Third Party Logging Integration Examples
Metrics
Extended Example: Database Query Event Metric Example
A complete walkthrough of designing and implementing an event metric to track the performance of database queries. Go to Developer's Guide - Metrics - Database Query Event Metric Example.
Packaging
PostSharp
- Log handled exceptions: Demonstrates a PostSharp aspect that logs exceptions after they're thrown when they cause a method to exit.
- Record feature utilization: Demonstrates a PostSharp aspect used to record how often a particular method in your application is used, how long it takes to run, and whether it was ultimately successful or not.
- Track the value of a class field: Demonstrates a PostSharp aspect that will record the value of a field as it changes throughout the lifespan of your application.
- Profile the performance of a method: Demonstrates a PostSharp aspect that is optimized for profiling a single method.
- Trace entry and exit from methods: Demonstrates a PostSharp aspect that records method entry and exit complete with parameter information and results.