You probably went through the three minute tutorial, and learnt the basics of DeskMetrics Analytics, such as downloading our library and DLL, adding it as a reference and making a very simple example using the DeskMetrics Analytics’ platform. If you haven’t done so, we recommend checking it out it before reading the complete documentation.
The DeskMetrics Analytics dotNet API is, basically, a wrapper for the DeskMetrics Analytics web service API. Its basic role is to take the data collected, serialize it into a JSON string and finally send it to DeskMetrics’ servers.
There are a few more features, like caching and background data sending (through a separate thread); If you are curious about our implementation, check our Delphi API code at Github
The basic Delphi API usage looks like:
use DeskMetrics;
//as the application starts:
DeskMetricsStart("your_app_id","1.0");
//as your application ends:
DeskMetricsStop;
Required function. Initializes the application by collecting some environment characteristics like operating system, Java and .NET version, processor, RAM usage and totals.
Required function. Must be called just before the application finishes.
This method sends the data stats that were cached locally until now. It is specially useful for applications that are never supposed to be closed. You should create a thread to call this function, so that your users don’t experience lags or performance issues.
The simplest event tracking. You can use it on button clicks, form loads or another user-triggered event.
Tracks events with the extra “Value” option.
Tracks custom data, like an specific user input. It can be useful when you want to get custom data without using TrackLog or TrackEventValue.
Tracks custom data in real time, without waiting for the scheduler to send it later. It throws an exception if the server communication can’t be established (e.g. no internet access)
This method can be used to track time-consuming operations (like a form-fill by a user or a disk defragmentation by some utility tool).
The EventTime parameter is the time spent on the event (in seconds) and the Completed parameter is used to inform to DeskMetrics Analytics if the event was successfully completed (false if it was cancelled/aborted or true, otherwise).
Simple log tracking.
Tracks an exception with its attributes (stack trace, source, target site and message).
Note
You can get your application id at http://analytics.deskmetrics.com/