Tsugi

Entry
in package

A adaptive, multi-scale compressed time series of event counter buckets

Table of Contents

Properties

$buckets  : mixed
The buckets key->value
$maxlen  : mixed
The default maximum length of a serialized set of buckets
$scale  : mixed
The scale in seconds
$timestart  : mixed
The earliest time for the first bucket - default first entry
$total  : mixed
The total number of clicks

Methods

__construct()  : mixed
click()  : mixed
Record a click.
deSerialize()  : mixed
De-Serialize scale, timestart and buckets (can be compressed)
reconstruct()  : mixed
Reconstruct to the actual times
reScale()  : mixed
Double the Scale - Return *copy of* new buckets
serialize()  : mixed
Serialize to a key=value pair
uncompressEntry()  : mixed
Optionally uncompress a serialized entry if it is compressed
viewModel()  : mixed
Produce an view model of the entire object

Properties

$buckets

The buckets key->value

public mixed $buckets = array()

$maxlen

The default maximum length of a serialized set of buckets

public mixed $maxlen = 0

$scale

The scale in seconds

public mixed $scale = 900

$timestart

The earliest time for the first bucket - default first entry

public mixed $timestart = null

$total

The total number of clicks

public mixed $total = 0

Methods

__construct()

public __construct([mixed $timestart = null ][, mixed $scale = 900 ][, mixed $maxlen = 1024 ]) : mixed
Parameters
$timestart : mixed = null
$scale : mixed = 900
$maxlen : mixed = 1024

click()

Record a click.

public click([mixed $time = null ]) : mixed

..

Parameters
$time : mixed = null

deSerialize()

De-Serialize scale, timestart and buckets (can be compressed)

public deSerialize(mixed $data) : mixed

Does not set total

Parameters
$data : mixed

reconstruct()

Reconstruct to the actual times

public reconstruct() : mixed

reScale()

Double the Scale - Return *copy of* new buckets

public reScale([mixed $factor = 2 ]) : mixed
Parameters
$factor : mixed = 2

serialize()

Serialize to a key=value pair

public serialize([mixed $maxlength = null ][, mixed $compress = false ]) : mixed
Parameters
$maxlength : mixed = null
$compress : mixed = false

uncompressEntry()

Optionally uncompress a serialized entry if it is compressed

public static uncompressEntry(mixed $text) : mixed
Parameters
$text : mixed

viewModel()

Produce an view model of the entire object

public viewModel() : mixed

This is a "view model" in that it is intended to be easily used in rendering situations.


        
On this page

Search results