Technology: Innovations
And Solutions
Tech-IS INC.

    • Home
    Help

    Azure Table Implementation of Activity Metrics

    Toronto. View from Queens Quay
    Toronto. View from Queens Quay.

     

    The TECHIS.Cloud.ActivityMetrics.AzureTable package is the Microsoft Azure implementation of the Activity Metrics System - AMS. See Activity Metrics for more details.

    The activities are stored in the Activities table for which the developer provides the table name.

    Use in Your Code

    1) Add or Delete Activities

    To add an occurrence or activity, you need to create an instance of the ActivityTracker, this you can do through the factory.

    var activityTracker = (new ActivityTrackerFactory<TableEntity>()).Create(tableName);

    To insert an activity, call the insert function:

    await activityTracker.InsertAsync(tableEntity);

    To delete, call the delete function:

    await activityTracker.DeleteAsync(new Identifier (rowKey, partitionKey));

    2) Generate Metrics

    To generate metrics, you need an instance of IMetricsGenerator which you can get from the metrics generator factory:

    var metricGeneratorFactory = new MetricsGeneratorFactory<long, EntityProperty, Configuration>();

    The Create function of a MetricsGenerator, takes an instance of a calculator. Read more about Calculators in Activity Metrics.

    var generator = metricGeneratorFactory.Create(calculator, sourceTable, metricsTable);

    var results = await generator.GenerateAsync(batch);

    3) Query for Metrics

    To read and display results use an instance of the IMetricsQueryable interface type.

    You can retrieve an instance of IMetricsQueryable through the factory:

    var query = new MetricQueryableFactory<DynamicTableEntity>().Create((string)null);

    var rows = await query.GetAsync(tableName, new QueryFilter("PartitionKey", [value]));

    Next Steps

    • Get the Nuget Package
    • Cosmos DB Table API
    • See Activity Metrics System (AMS)
    • Reactions: An Implementation
    • Get test project
    • Get in touch
    • {5}{0}
      {4}
    [currentIframe]
      [thumbs]

      [MenuTitle]
        text-align: center; border-bottom-width: 1px; border-bottom-style: solid; position: static;
        text-align: center; border-bottom-width: 1px; border-bottom-style: solid; position: static; line-height: 1.2em; font-weight: lighter;
        border-bottom-width: 1px; border-bottom-style: solid; position: static; line-height: 1.2em; font-weight: lighter;
        line-height: 1.2em; font-weight: lighter; padding-left: 0.75em; margin-bottom: 0px;

        {0}

        {0}


        {1}

        {0}
        Your comment has been posted
        To see your comment in Forums and Topics, click here

        Comments

        Sign-in/Register to comment
        Show Comments
        Oops! We don't have That. No posts, yet :-)

        Back to Top

        Page top Help About