Creating a statistic definition
We’re going to start by creating a statistic definition, at this level we don’t need to add any special configuration for the transactional writes.Adding data to a statistic
Continuing with our example, we are going to add data to the previously defined Statistic. The key difference between a normal request and this one is the specialTransactionId parameter. This parameter serves as an
identifier for the request being executed. Each time a new request arrives, the system compares the new
transaction IDs with those identifiers that were already processed. If a match is found, the request is not going to be executed.
One key aspect to consider is that this transactional behavior establishes a relationship between the
TransactionId and the request being executed, not with the individual statistics within that request.
There isn’t a mapping for each individual stat; the mapping is for the entire request. Also, when this feature
is being used we have a different meter for tracking this type of requests, learn more here: Statistics meters
Entity: This parameter corresponds to the entity from which we want to make the update of the stat.TransactionId: This parameter corresponds to a string that represents a unique identifier for the request.Statistics: This parameter corresponds to the actual set of statistics of an entity.StatisticUpdate: This parameter corresponds to the statistics values that are going to be added.Scores: This parameter corresponds to the list of scores you can add to one entity. Remember, statistics can have more than one column. You can check these concepts in depth here: Doing More With StatisticsName: This parameter corresponds to the statistic name set when you created the statistic definition.
