Technology: Innovations
And Solutions
Tech-IS INC.

TECHIS.Cloud.ActivityMetrics.Reactions

Toronto. The "Twin Towers" standout from behind the Sunlife building. Queens Quay
Toronto. The "Twin Towers" standout from behind the Sunlife building. Queens Quay

 

The TECHIS.Cloud.ActivityMetrics.Reactions package builds on the TECHIS.Cloud.ActivityMetrics.AzureTables package, which in itself, is an implementation of TECHIS.Cloud.ActivityMetrics (AMS - Activity Metrics System). Please look at the brief documentation of both packages. 

This package is suitable for occurrences (Activities) that has the following properties;

Subject Id (Integer)

Subject Type Id (String)

Value (String)

ValueType (String)

Actor (String)

 

Restricting Subject Id to integer allows us to perform range queries against Subject Id with predictable results.

Given the above restrictions, we can state that this package tracks occurrences and generates metrics against those occurrences.

 

To Add an occurrence, call:

Activity.AddAsync(subjectId, subjectTypeId, value, valueType, actor)

To generate the Count Metric, call:

MetricsCountWriter.Write()

 

There are two ways to read the Metrics that have been generated:

  • Using a range query
  • Using a points query – query for a collection of data points

To run a range query, call;

MetricsReader. QueryAsync(minSubjectId, maxSubjectId, subjectTypeId, count)

To run a points query, call

MetricsReader. QueryPointsAsync(subjectIds, subjectTypeId, count)

*subjectIds represents an array of subjectIds

*count represents the size of the result set to return

The Count Metric is the only metric generator that is included in this package. You can always create your own or let us know which other metrics you would like. Other potential metrics that you may wish to calculate are, the averages – mean, median, mode, standard deviation, margin of error, min, max, et cetera.

 

This package depends on TECHIS.Cloud.ActivityMetrics.AzureTable which uses the Microsoft.Azure.CosmosDB.Table. This is the new Azure Table API which can target either CosmosDB or Azure Storage Tables.

This package will create 3 tables:

  • An occurrence table - "EndAppsReactions"
  • A Metric table - "EndAppsReactionsMetrics"
  • A Metric history table- "EndAppsReactionsMetricsHistory"

You can change the names of the tables by assigning new names in the Settings class.