# DeviceAtlas Connectivity Analyser #
The DeviceAtlas Connectivity Analyser is used to measure the round trip time when
sending a payload of a fixed size to a client. This measures a combination of
latency and bandwidth. The measured time is then used to categorize the
client's current connection into low, medium or high.
### Dependencies ###
This library does not depend on any third party libraries.
### Usage ###
#### Import the Connectivity Analyser Library ####
##### .NET Framework #####
Add deviceatlas-connectivity-analyser-x.x.dll into your project.
##### .NET Core #####
Add deviceatlas-connectivity-analyser-core-x.x.dll into your project.
#### Use the Library ####
##### .NET Framework #####
```csharp
Import Namespace="Mobi.Mtld.DeviceAtlas";
// create a ConnectivityAnalyser object with default settings
ConnectivityAnalyser connectivityAnalyser = new ConnectivityAnalyser();
/*
// create a ConnectivityAnalyser object with manual settings
Hashtable settings = new Hashtable();
settings.Add("frequency", 4);
settings.Add("payload", 10000);
settings.Add("lowquality", 1000);
settings.Add("midquality", 500);
ConnectivityAnalyser connectivityAnalyser = new ConnectivityAnalyser(settings);
*/
// get the results
long duration = connectivityAnalyser.GetDuration();
string quality = connectivityAnalyser.GetQuality();
```
##### .NET Core #####
```csharp
Import Namespace="Mobi.Mtld.DeviceAtlas";
// create a ConnectivityAnalyser object with default settings
ConnectivityAnalyser connectivityAnalyser = new ConnectivityAnalyser(HttpContext);
/*
// create a ConnectivityAnalyser object with manual settings
Hashtable settings = new Hashtable();
settings.Add("frequency", 4);
settings.Add("payload", 10000);
settings.Add("lowquality", 1000);
settings.Add("midquality", 500);
ConnectivityAnalyser connectivityAnalyser = new ConnectivityAnalyser(HttpContext, settings);
*/
// get the results
long duration = connectivityAnalyser.GetDuration();
string quality = connectivityAnalyser.GetQuality();
```
Please see the example application for more detail.
### Options ###
* payload
- The amount of data to send to the client as part of the bandwidth
measurement. Defaults to 1KB.
* frequency
- Defines how often to re-measure the connectivity analyser for a given
user. If this is set to 1 then the network performance is checked on
every request. If it is greater than 1 the network performance is
only checked every X requests and the previous values are returned
until X requests is reached. Defaults to 1.
* lowquality/midquality
- The thresholds to define the low and mid tiers. The threshold is
defined in ms. Everything faster than the mid threshold is
classified as high quality.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_ Copyright (c) DeviceAtlas Limited 2021. All Rights Reserved. https://deviceatlas.com _