Class: Snapshot

Koviko.Snapshot()

A collection of attributes and a comparison of those attributes from one snapshot to the next.

Constructor

new Snapshot()

Source:

Members

_isInitialized :boolean

Whether the attributes have been initialized
Type:
  • boolean
Source:

attributes :Object.<string, number>

Valid attributes for a snapshot
Type:
  • Object.<string, number>
Source:

Methods

(static) get() → {Object.<string, Koviko.Snapshot~Comparison>}

Get the snapshot.
Source:
Returns:
Comparison values from the last snapshot to the current one
Type
Object.<string, Koviko.Snapshot~Comparison>

(static) init(attributes) → {Object.<string, Koviko.Snapshot~Comparison>}

Initialize the attributes to consider in each snapshot.
Parameters:
Name Type Description
attributes Koviko.Snapshot~Attributes Attributes and their values
Source:
Returns:
Initial comparison values
Type
Object.<string, Koviko.Snapshot~Comparison>

(static) snap(attributes) → {Object.<string, Koviko.Snapshot~Comparison>}

Take a snapshot of the attributes and compare them to the previous snapshot.
Parameters:
Name Type Description
attributes Koviko.Snapshot~Attributes Attributes and their values
Source:
Returns:
Comparison values from the last snapshot to the current one
Type
Object.<string, Koviko.Snapshot~Comparison>

Type Definitions

Attributes

Attributes to consider from one snapshot to the next.
Type:
  • Object.<string, number>
Source:

Comparison

Comparison of current snapshot to last snapshot.
Type:
  • Object
Properties:
Name Type Description
value number New value after the snapshot is taken
delta number Difference between new value and old value
Source: