package tezt-tezos

  1. Overview
  2. Docs
Octez test framework based on Tezt

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/tezt-tezos.tezt-performance-regression/Tezt_tezos_tezt_performance_regression/InfluxDB/index.html

Module Tezt_tezos_tezt_performance_regression.InfluxDBSource

Send and retrieve data points from InfluxDB.

Sourcetype credentials = {
  1. username : string;
  2. password : string;
}

Credentials used to authenticate to the database.

Sourcetype config =
  1. | V1_8 of {
    1. url : Uri.t;
    2. database : string;
    3. credentials : credentials option;
    4. measurement_prefix : string;
    5. tags : (string * string) list;
    6. timeout : float;
    }

InfluxDB configuration.

url is the base URL of the InfluxDB API.

database is the name of the InfluxDB database to read from and write to.

credentials are used to authenticate to this database. If not provided, it will try to connect without authenticating (insecure mode).

measurement_prefix is prepended to all measurement names when sending data points and in SELECT queries.

tags is added to the tags of all data points when sending data points.

Sourceval config_of_json : Tezt_wrapper.JSON.t -> config

Read an InfluxDB configuration from a JSON value.

Sourcetype measurement = string

Measurement names for data points.

Sourcetype tag = string

Tag names for data points.

Sourcetype field = string

Field names for data points.

Sourcetype field_value =
  1. | Float of float
  2. | String of string

Field values for data points.

Sourcetype timestamp = float

Unix timestamps as returned by Unix.gettimeofday.

Sourcetype data_point = private {
  1. measurement : measurement;
  2. tags : (tag * string) list;
  3. first_field : field * field_value;
  4. other_fields : (field * field_value) list;
  5. timestamp : timestamp;
}

Data points (see function data_point).

Sourceval data_point : ?tags:(tag * string) list -> ?other_fields:(field * field_value) list -> ?timestamp:timestamp -> measurement -> (field * field_value) -> data_point

Create a data point.

Usage: data_point measurement key_value

Data points are composed of:

  • a name measurement;
  • a possibly-empty list of tags to complete the name;
  • a non-empty list of (key, value) fields, composed of key_value and other_fields;
  • a UNIX timestamp (default value is now). See the documentation of InfluxDB for more information about those components.
  • raises Invalid_arg

    if one of the tags, tag values, fields, field values, or measurement contains a newline character.

Sourceval add_tag : tag -> string -> data_point -> data_point

Add a tag to a data point.

  • raises Invalid_arg

    if the tag or the value contains a newline character.

Sourceval show_data_point : data_point -> string

Convert a data point to a string for display purposes.

Sourceval write : config -> data_point list -> unit Lwt.t

Push data points to InfluxDB.

Return Error message if the data could not be sent, where message is a human-readable error message.

InfluxQL

This section provides a select type that is an AST of InfluxQL SELECT queries, and a function to perform those queries.

See the documentation of InfluxQL here: https://docs.influxdata.com/influxdb/v1.8/query_language/explore-data

Sourcetype time_interval =
  1. | Ns of int
    (*

    nanoseconds

    *)
  2. | U of int
    (*

    microseconds

    *)
  3. | Ms of int
    (*

    milliseconds

    *)
  4. | S of int
    (*

    seconds

    *)
  5. | M of int
    (*

    minutes

    *)
  6. | H of int
    (*

    hours

    *)
  7. | D of int
    (*

    days

    *)
  8. | W of int
    (*

    weeks

    *)
  9. | Grafana_interval

Time interval specifications for InfluxQL queries.

Grafana_interval denotes $__interval, a placeholder that Grafana replaces with an interval which is proportional to the selected time window size. Use this in a GROUP BY clause. Example: ~group_by: (Time {interval = Grafana_interval; tag = None; fill = Some Previous}). If you try to actually query a select with this, query raises Invalid_arg.

Sourcetype func =
  1. | COUNT
  2. | DISTINCT
  3. | INTEGRAL of time_interval
  4. | MEAN
  5. | MEDIAN
  6. | MODE
  7. | SPREAD
  8. | STDDEV
  9. | SUM

Functions for InfluxQL SELECT queries.

Sourceval column_name_of_func : func -> string

Get the name of the column for a given function in query results.

Sourcetype argument =
  1. | All
  2. | Field of string

Arguments of functions for InfluxQL SELECT queries.

Sourcetype column =
  1. | All
  2. | Field of string
  3. | Tag of string
  4. | Function of func * argument

Columns to retrieve using InfluxQL SELECT queries.

Sourcetype tag_operator =
  1. | EQ
  2. | NE

Operators for tag comparisons in WHERE clauses.

Sourcetype field_operator =
  1. | EQ
  2. | NE
  3. | GT
  4. | GE
  5. | LT
  6. | LE

Operators for field comparisons in WHERE clauses.

Sourcetype where =
  1. | Tag of string * tag_operator * string
  2. | Field of string * field_operator * field_value
  3. | Or of where * where
  4. | And of where * where
  5. | Grafana_time_filter

WHERE clauses of InfluxQL SELECT queries.

Grafana_time_filter denotes $timeFilter, a placeholder that Grafana replaces with a predicate on time which denotes the time window that the user selected in Grafana. If you try to actually query a select with this, query raises Invalid_arg.

Sourcetype fill =
  1. | Value of float
  2. | Linear
  3. | F_none
  4. | Null
  5. | Previous

Fill argument of GROUP BY time clauses.

Sourcetype group_by =
  1. | All_tags
  2. | Tags of tag list
  3. | Time of {
    1. interval : time_interval;
    2. tag : tag option;
    3. fill : fill option;
    }

GROUP BY clauses of InfluxQL SELECT queries.

Sourcetype order_by =
  1. | Time_desc

ORDER BY clauses of InfluxQL SELECT queries.

Sourcetype select = {
  1. columns : column list;
  2. from : from;
  3. where : where option;
  4. group_by : group_by option;
  5. order_by : order_by option;
  6. limit : int option;
  7. slimit : int option;
}

InfluxQL SELECT queries.

Sourceand from =
  1. | Measurement of string
  2. | Select of select

FROM clauses of InfluxQL SELECT queries.

Sourceval select : from:from -> ?where:where -> ?group_by:group_by -> ?order_by:order_by -> ?limit:int -> ?slimit:int -> column list -> select

Make an InfluxQL SELECT query.

Sourceval show_select : ?grafana:bool -> select -> string

Convert a SELECT query to a string for display purposes.

If grafana is true, allow Grafana_time_filter and Grafana_interval. Default is false.

  • raises Invalid_arg

    if grafana is false and the query contains Grafana_time_filter or Grafana_interval.

Sourceval prefix_measurement : config -> select -> select

Prepend the measurement of the innermost SELECT query with the configured prefix.

This is automatically done by query.

Sourcetype result_data_point

Data points returned when making a SELECT query.

Sourceval show_result_data_point : result_data_point -> string

Convert a data point returned by a SELECT query to a human-readable string.

Sourceval query : config -> select -> result_data_point list list Lwt.t

Perform a SELECT query.

  • raises Invalid_arg

    if the query contains Grafana_time_filter or Grafana_interval.

Sourceval get : string -> (Tezt_wrapper.JSON.t -> 'a) -> result_data_point -> 'a

Get a value from a data point in a query result.

Example: get "count" JSON.as_int

Sourceval show_query_result : result_data_point list list -> string

Convert results from a SELECT query into a string for debugging purposes.

OCaml

Innovation. Community. Security.