Handle operation on networkAnalysis sensor.

Usage

networkAnalysis keyword is needed to instanciate this sting.

var networkAnalysis = require('networkAnalysis');

Data accessors

Methods

Full Example

var networkAnalysis = require('networkAnalysis');
var recorder = require('recorder');

var dataResult = networkAnalysis.data();
var onDnsRequestResult = networkAnalysis.onDnsRequest(filtercallback);
var onPingRequestResult = networkAnalysis.onPingRequest(filtercallback);
var onTcpDownloadResult = networkAnalysis.onTcpDownload(filtercallback);
var onTcpUploadResult = networkAnalysis.onTcpUpload(filtercallback);
var onTracerouteRequestResult = networkAnalysis.onTracerouteRequest(filtercallback);
var onUdpDownloadResult = networkAnalysis.onUdpDownload(filtercallback);
var onUdpUploadResult = networkAnalysis.onUdpUpload(filtercallback);


recorder.save({
    'duration' : networkAnalysis.duration(),
    'error' : networkAnalysis.error(),
    'hostname' : networkAnalysis.hostname(),
    'ip' : networkAnalysis.ip(),
    'jitter' : networkAnalysis.jitter(),
    'lossRatio' : networkAnalysis.lossRatio(),
    'UNKNOWN NetworkType' : networkAnalysis.isNetworkType(networkAnalysis.UNKNOWN),
    'outOfOrderRatio' : networkAnalysis.outOfOrderRatio(),
    'packetCount' : networkAnalysis.packetCount(),
    'records' : networkAnalysis.records(),
    'rtt' : networkAnalysis.rtt(),
    'size' : networkAnalysis.size(),
    'speed' : networkAnalysis.speed(),
    'speeds' : networkAnalysis.speeds(),
    'task' : networkAnalysis.task(),
    'timestamp' : networkAnalysis.timestamp(),
    'traceroute' : networkAnalysis.traceroute(),
    'ttl' : networkAnalysis.ttl(),
    'json' : networkAnalysis.data()
});

duration

Retrieve the The test duration in milliseconds.

duration();

Parameters

  • None.

Return

  • duration : Long, The test duration in milliseconds

error

Retrieve the Describe the task error if any occurred.

error();

Parameters

  • None.

Return

  • error : String, Describe the task error if any occurred

hostname

Retrieve the [ping, traceroute, dns] The asked hostname.

hostname();

Parameters

  • None.

Return

  • hostname : String, [ping, traceroute, dns] The asked hostname

ip

Retrieve the The test destination IP.

ip();

Parameters

  • None.

Return

  • ip : String, The test destination IP

isNetworkType

Test the current networkType value against the given one.

isNetworkType(value);

Parameters

Return

  • Boolean

jitter

Retrieve the [burst] Jitter as specified in RFC3393.

jitter();

Parameters

  • None.

Return

  • jitter : Long, [burst] Jitter as specified in RFC3393

lossRatio

Retrieve the [burst] Ratio of lost packets over the total number of packet.

lossRatio();

Parameters

  • None.

Return

  • lossRatio : Float, [burst] Ratio of lost packets over the total number of packet

networkType

Retrieve the Describe the type of network the user is on.

networkType();

Parameters

  • None.

Return

outOfOrderRatio

Retrieve the [burst] Ratio of late packets over the total number of packet.

outOfOrderRatio();

Parameters

  • None.

Return

  • outOfOrderRatio : Float, [burst] Ratio of late packets over the total number of packet

packetCount

Retrieve the [burst] Number of sent packet.

packetCount();

Parameters

  • None.

Return

  • packetCount : Integer, [burst] Number of sent packet

records

Retrieve the [dns] List of DNS entries.

records();

Parameters

  • None.

Return

  • records : List, [dns] List of DNS entries

rtt

Retrieve the [ping] The RTT information.

rtt();

Parameters

  • None.

Return

  • rtt : Rtt, [ping] The RTT information

size

Retrieve the [download, upload] Size of the last download/upload.

size();

Parameters

  • None.

Return

  • size : Float, [download, upload] Size of the last download/upload

speed

Retrieve the [download, upload] Median speed of last download/upload.

speed();

Parameters

  • None.

Return

  • speed : Float, [download, upload] Median speed of last download/upload

speeds

Retrieve the [download, upload] List of speed sample for last download/upload.

speeds();

Parameters

  • None.

Return

  • speeds : List, [download, upload] List of speed sample for last download/upload

task

Retrieve the The name of the last executed task.

task();

Parameters

  • None.

Return

  • task : String, The name of the last executed task

timestamp

Retrieve the represents the time of the operation..

timestamp();

Parameters

  • None.

Return

  • timestamp : Long, represents the time of the operation.

traceroute

Retrieve the [traceroute] Last traceroute data.

traceroute();

Parameters

  • None.

Return

  • traceroute : List, [traceroute] Last traceroute data

ttl

Retrieve the [ping, traceroute] The last found TTL.

ttl();

Parameters

  • None.

Return

  • ttl : Integer, [ping, traceroute] The last found TTL

data

Returns every available seed.

data();

Parameters

  • None.

Returns

onDnsRequest

Send a DNS request and report the results

onDnsRequest(filtercallback);

Parameters

  • filter (Map): filters to apply
  • callback (Object): onDone callback

Returns

  • JSPromise

onPingRequest

Send a ping request and report the results

onPingRequest(filtercallback);

Parameters

  • filter (Map): filters to apply
  • callback (Object): onDone callback

Returns

  • JSPromise

onTcpDownload

Download the required data size and report network statistics

onTcpDownload(filtercallback);

Parameters

  • filter (Map): filters to apply
  • callback (Object): onDone callback

Returns

  • JSPromise

onTcpUpload

Upload the required data size and report network statistics

onTcpUpload(filtercallback);

Parameters

  • filter (Map): filters to apply
  • callback (Object): onDone callback

Returns

  • JSPromise

onTracerouteRequest

Send a traceroute request and report the results

onTracerouteRequest(filtercallback);

Parameters

  • filter (Map): filters to apply
  • callback (Object): onDone callback

Returns

  • JSPromise

onUdpDownload

Send the required number of packets and report network statistics

onUdpDownload(filtercallback);

Parameters

  • filter (Map): filters to apply
  • callback (Object): onDone callback

Returns

  • JSPromise

onUdpUpload

Send the required number of packets and report network statistics

onUdpUpload(filtercallback);

Parameters

  • filter (Map): filters to apply
  • callback (Object): onDone callback

Returns

  • JSPromise