length

length — finds the total number of values in a history.

Syntax

(length history [start [end]])
    

Parameters

history

The name of a history defined by the history command.

start

Optional, the start of a desired time range in seconds, expressed as a real number. The default is the first value available.

end

Optional, the end of a desired time range in seconds, expressed as a real number. The default is the last value available.

Returns

An integer number of values in the history between the specified start and end times, in this format:

(length history length)

on success, otherwise:

(error "History history does not exist")

Description

This command queries the history for the total number of values available.

This command corresponds to the Cogent C API function HI_Length and the hist_length dynamic library function.

Example

[sh]$ lsend Hist
Hist> (length p3)
(length p3 2853)
Hist> (length p3 973632000.500 973636000.500)
(length p3 11)
Hist>