TripwireEvent

mdxWebApiCore.Metrics. TripwireEvent

Class which defines TripwireEvent

Constructor

new TripwireEvent()

Source:

Methods

(async) getTripwireCounts(documentDb, input) → {Promise.<Object>}

Description:
  • returns an object containing effective and actual tripwire counts.
Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {sensorId: "abc", fromTimestamp: "2023-01-12T11:20:10.000Z", toTimestamp: "2023-01-12T14:20:10.000Z"};
let tripwireMetricObject = new mdx.Metrics.TripwireEvent();
let tripwireCounts = await tripwireMetricObject.getTripwireCounts(elastic,input);
Parameters:
Name Type Description
documentDb Database Database Object
input Object Input object.
Properties
Name Type Attributes Default Description
sensorId string
tripwireId string <optional>
<nullable>
null
fromTimestamp string
toTimestamp string
objectType string <optional>
"Person"
Returns:
Effective and actual tripwire counts are returned
Type
Promise.<Object>

(async) getTripwireHistogram(documentDb, input) → {Promise.<Object>}

Description:
  • returns an object containing histogram of actual and effective tripwire counts.
Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {sensorId: "abc", fromTimestamp: "2023-01-12T11:20:10.000Z", toTimestamp: "2023-01-12T14:20:10.000Z",bucketCount:24};
let tripwireMetricObject = new mdx.Metrics.TripwireEvent();
let histogramResult = await tripwireMetricObject.getTripwireHistogram(elastic,input);
Parameters:
Name Type Description
documentDb Database Database Object
input Object Input object.
Properties
Name Type Attributes Default Description
sensorId string
tripwireId string <optional>
<nullable>
null
fromTimestamp string <optional>
Either fromTimestamp and toTimestamp should be present together or minutesAgo should be present.
toTimestamp string <optional>
Either fromTimestamp and toTimestamp should be present together or minutesAgo should be present.
minutesAgo number <optional>
minutesAgo must be an integer. Either fromTimestamp and toTimestamp should be present together or minutesAgo should be present.
bucketCount number <optional>
20 bucketCount must be an integer.
objectType string <optional>
"Person"
Returns:
Histogram of actual and effective tripwire counts is returned
Type
Promise.<Object>