Mozilla Telemetry Histogram Module
1. Functions
1.1. create
Creates a histogram table with the expected schema.
Arguments
- rows (integer) - Number of rows in the histogram matrix
- ebuckets (nil/table) - Cache for the exponential buckets hash
Return
- histograms (table)
1.2. clear_row
Clears the specified row in all histograms.
Arguments
- histograms (table) - Histograms data structure
- rows (integer) - Row index to clear
Return
- none
1.3. process
Process the telemetry histogram JSON and updates the histogram data structure.
Arguments
- ns (integer) - Nanoseconds since Jan 1 1970
- json (table) - Telemetry histogram data structure
- histograms (table) - Histogram analysis data structure
- row (integer) - Hintogram row to apply the updates to
Return
- none
1.4. output
Runs the histogram analysis and output the Histograms data structure as JSON.
Arguments
- histograms (table) - Histograms data structure
- row (integer) - Histogram row to analyze
- graphs (array) - Collection of debug graphs
Return
- none (all output is written to the payload buffer)
1.5. alert
Turn the graphs array into a dashboard display and generate an alert linking back to it when applicable.
Arguments
- graphs (array) - Collection of debug graphs
Return
- none
1.6. output_viewer_html(schema_name, schema_ext)
Outputs the HTML viewer for the histogram data an the first invocation.
Arguments
- name (string) - Data file that this viewer will load
- extension (string) - Data file extension that this viewer will load
Return
- none
1.7. get_exponential_buckets
Takes an exponential histogram specification and returns the value to bucket index mapping.
Arguments
- min (integer) - Minimum bucket value
- max (integer) - Maximum bucket value
- cnt (integer) - Number of buckets
- cache (nil/table) - Cache for the exponential buckets hash
Return
- buckets (hash) - Hash of bucket values to index mapping
source code: histogram.lua