Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RTS

Hierarchy

  • Module
    • RTS

Index

Constructors

  • new RTS(clusterNodes: ClusterNode[], moduleOptions?: RedisModuleOptions, clusterOptions?: ClusterOptions): RTS
  • new RTS(redisOptions: RedisOptions, moduleOptions?: RedisModuleOptions): RTS
  • Initializing the module object

    Parameters

    • clusterNodes: ClusterNode[]

      The nodes of the cluster

    • Optional moduleOptions: RedisModuleOptions

      The additional module options

    • Optional clusterOptions: ClusterOptions

      The options of the clusters

    Returns RTS

  • Initializing the module object

    Parameters

    • redisOptions: RedisOptions

      The options of the redis database

    • Optional moduleOptions: RedisModuleOptions

      The additional module options

    Returns RTS

Properties

cluster: Cluster
clusterNodes: ClusterNode[]
clusterOptions: ClusterOptions
isHandleError: boolean
name: string
redis: Redis
redisOptions: RedisOptions
returnRawResponse: boolean
rtsCommander: RedisTimeSeriesCommander = ...
showDebugLogs: boolean

Methods

  • add(key: string, timestamp: string, value: string, options?: TSAddOptions): Promise<number>
  • Appending/creating a new sample to series

    Parameters

    • key: string

      The key

    • timestamp: string

      The timestamp

    • value: string

      The value

    • Optional options: TSAddOptions

      The 'TS.ADD' command optional parameters

    Returns Promise<number>

  • alter(key: string, options?: TSAlterOptions): Promise<"OK">
  • Altering an existing TS key

    Parameters

    • key: string

      Required. The key

    • Optional options: TSAlterOptions

    Returns Promise<"OK">

  • connect(): Promise<void>
  • Connecting to the Redis database with the module

    Returns Promise<void>

  • Creating a new TS key

    Parameters

    • key: string

      The key

    • Optional options: TSCreateOptions

      The 'TS.CREATE' optional parameter

    Returns Promise<"OK">

    "OK"

  • Creating a new sample that decrements the latest sample's value

    Parameters

    • key: string

      The key

    • value: string

      The value

    • Optional options: TSIncrbyDecrbyOptions

      The 'TS.DECRBY' command optional parameters

    Returns Promise<number>

  • del(key: string, fromTimestamp: string, toTimestamp: string): Promise<number>
  • Delete data points for a given timeseries and interval range in the form of start and end delete timestamps.

    Parameters

    • key: string

      Key name for timeseries

    • fromTimestamp: string

      Start timestamp for the range deletion.

    • toTimestamp: string

      End timestamp for the range deletion.

    Returns Promise<number>

    The count of samples deleted

  • deleterule(sourceKey: string, destKey: string): Promise<"OK">
  • Deleting a compaction rule

    Parameters

    • sourceKey: string

      The source key

    • destKey: string

      The dest key

    Returns Promise<"OK">

  • disconnect(): Promise<void>
  • Disconnecting from the Redis database with the module

    Returns Promise<void>

  • get(key: string): Promise<(string | number)[]>
  • Retrieving the last sample of a key

    Parameters

    • key: string

      The key

    Returns Promise<(string | number)[]>

  • handleError(error: string): any
  • Handling a error

    Parameters

    • error: string

      The message of the error

    Returns any

  • handleResponse(response: any): any
  • Simpilizing the response of the Module command

    Parameters

    • response: any

      The array response from the module

    Returns any

  • Creating a new sample that increments the latest sample's value

    Parameters

    • key: string

      The key

    • value: string

      The value

    • Optional options: TSIncrbyDecrbyOptions

      The 'TS.INCRBY' command optional parameters

    Returns Promise<number>

  • info(key: string): Promise<TSInfo>
  • Retrieving information and statistics on the time-series

    Parameters

    • key: string

      The key

    Returns Promise<TSInfo>

  • isOnlyTwoDimensionalArray(array: any[]): boolean
  • Check if array is fully two dimensional. Only items in the array are arrays.

    Parameters

    • array: any[]

      The potential two dimensional array

    Returns boolean

  • madd(keySets: TSKeySet[]): Promise<number[]>
  • Appending new samples to a list of series

    Parameters

    Returns Promise<number[]>

  • mget(filter: string, withLabels?: boolean): Promise<(string | number)[][]>
  • Retrieving the last sample of a key by filter

    Parameters

    • filter: string

      Required. The filter

    • Optional withLabels: boolean

      Optional. If to add the 'WITHLABELS' Optional parameter

    Returns Promise<(string | number)[][]>

  • mrange(fromTimestamp: string, toTimestamp: string, filter: string, options?: TSMRangeOptions): Promise<(string | number)[][]>
  • Querying a range across multiple time-series by filters in forward directions

    Parameters

    • fromTimestamp: string

      The starting timestamp

    • toTimestamp: string

      The ending timestamp

    • filter: string

      The filter

    • Optional options: TSMRangeOptions

      The 'TS.MRange' command optional parameters

    Returns Promise<(string | number)[][]>

  • mrevrange(fromTimestamp: string, toTimestamp: string, filter: string, options?: TSMRangeOptions): Promise<(string | number)[][]>
  • Querying a range across multiple time-series by filters in reverse directions

    Parameters

    • fromTimestamp: string

      The starting timestamp

    • toTimestamp: string

      The ending timestamp

    • filter: string

      The filter

    • Optional options: TSMRangeOptions

      The 'TS.MRange' command optional parameters

    Returns Promise<(string | number)[][]>

  • paramToString(paramValue: string): string
  • Formatting given param value to string

    Parameters

    • paramValue: string

      The given param value

    Returns string

    A param value converted to string

  • queryindex(filter: string): Promise<string[]>
  • Retrieving all the keys matching the filter list

    Parameters

    • filter: string

      The filter

    Returns Promise<string[]>

  • range(key: string, fromTimestamp: string, toTimestamp: string, options?: TSRangeOptions): Promise<[number, string][]>
  • Querying a range in forward directions

    Parameters

    • key: string

      The key

    • fromTimestamp: string

      The starting timestamp

    • toTimestamp: string

      The ending timestamp

    • Optional options: TSRangeOptions

      The 'TS.Range' command optional parameters

    Returns Promise<[number, string][]>

  • reduceArrayDimension(array: any[][]): any[]
  • Reducing an array by one level. i.e. from two dimensional to 1 dimensional.

    Parameters

    • array: any[][]

      The potentional two dimensional array

    Returns any[]

  • revrange(key: string, fromTimestamp: string, toTimestamp: string, options?: TSRangeOptions): Promise<[number, string][]>
  • Querying a range in reverse directions

    Parameters

    • key: string

      The key

    • fromTimestamp: string

      The starting timestamp

    • toTimestamp: string

      The ending timestamp

    • Optional options: TSRangeOptions

      The 'TS.Range' command optional parameters

    Returns Promise<[number, string][]>

  • sendCommand(data: CommandData): Promise<any>
  • Running a Redis command

    Parameters

    • data: CommandData

      The command data of a command to send. Consists of command and args.

    Returns Promise<any>

Generated using TypeDoc