How Can You View the Billing Data that Vantiq Uses?

How Can You View the Billing Data that Vantiq Uses?

Vantiq customers are billed using a tiered model based upon the number of Event Messages processed per month.  If you are an organization admin for a Vantiq organization then you may want to track how many messages are generated at any interim point within a monthly billing period in order to be able to make appropriate adjustments to the event message usage of your applications.

You need to know how the raw data is stored and how to write some basic queries that extract and combine the data in the same way that Vantiq does.

What is an Event Message?

Event Message Definition.  An “Event Message” is any inbound message to or outbound message from all Vantiq namespaces in an application hosted on a Vantiq Cloud Edition or a Vantiq Server Edition, including messages between Vantiq applications running in separate namespaces (i.e., any time a message crosses a security boundary).   Only inbound messages to and outbound messages from production servers are counted, not messages to or from development servers.  Events processed by Edge Nodes are not counted as Event Messages.   Event Messages include, but are not limited to:

  • All messages sent to or received from a standard Vantiq Source, including but not limited to: MQTT; AMQP; email; Kafka; chat; plus any extension sources that are built.
  • Messages sent or received via web socket
  • REST requests to or from Vantiq servers

Calculation of Event Messages per Month.  For purposes of calculating Event Messages per Month, the following rules will apply:

  • Event Messages under 2KB in size will be counted as one (1) Event Message;
  • Each Event Message 2KB or greater in size will be counted as two (2) or more Event Messages, according to the following formula: [size of event message] divided by 2KB, rounded up to the nearest whole number.  For example, a 9KB Event Message will be counted as five (5) Event Messages, as follows:  9KB/2KB= 4.5 rounded up to 5
  • If Customer licenses Vantiq Cloud Edition, each Machine Learning Event Message will count as five hundred (500) Event Messages.  For this purpose, a “Machine Learning Event Message” is an Event Message that requires processing by a graphics processing unit (GPU).
  • The count includes the entire event including all the protocol headers for the HTTP/WebSocket/MQTT/etc. that are exposed at the application protocol layer.
  • The application code is not counted implying HTML, CSS, JavaScript and images that are part of the application definition are not counted. However, that applies ONLY to images and other artifacts that are part of the application definition. If your application explicitly sends images to the Vantiq servers or reads images from the Vantiq servers, they will be counted as events using the counting algorithm described above.

The messagecounts Type
The system.messagecounts type has the following properties:

  • organization (String) – always contains the organization in which you are running
  • timestamp (DateTime) – records every minute of every hour/day/etc.
  • count (Integer) – message count for the last minute (see timestamp)

Sample Queries
The queries below report “Month-to-date” data.  The use case is that you want to know how many event mesages have been recorded by Vantiq since the start of the month – the day that the current billing cycle began.

IMPORTANT NOTE: The expiresAfter property of the messagecounts type is set to “35 days”.  This means that if you want to gather your own monthly data you have, on average, 5 days to do it before the older records are aged out of the type.

The procedure below illustrates two queries:

  1. The total number of data points (minute by minute) that are being summed since the start of the current month (in this example, the current month is September 2020).
  2. The sum of every data point in #1.  This is the total number of billable messages since the start of the month.

PROCEDURE messageCount_queries()
var startOfMonth = toDate(“2020-09-01T00:00:00Z”)

log.info(“startOfMonth = {}”,[startOfMonth])

var count = select count = count() FROM system.messagecounts as mc
where timestamp >= startOfMonth

var monthToDate = select monthToDate = sum(count) FROM system.messagecounts as mc
where timestamp >= startOfMonth

return ([count, monthToDate])

 

Posted: October 19, 2020 at 9:47 pm
Replies: 0
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy